Download presentation
Presentation is loading. Please wait.
Published byAllen Freeman Modified over 6 years ago
1
Customizing Your Email Messages with Velocity Templates
CONFIDENTIAL Customizing Your Messages with Velocity Templates User Group Meeting October 21, 2015 Patrick Rose
2
Topics Why Custom Emails? What is Velocity? Email Settings
CONFIDENTIAL Topics Why Custom s? What is Velocity? Settings Trigger Configuration Velocity Content Examples More Complex Examples
3
Why Custom Emails? Emails sent when conditions are met
CONFIDENTIAL Why Custom s? s sent when conditions are met New or published data Updated data Data is a specific value s sent to specific users who start next business process or make decisions based on data Standard s very generic in content and do not include specific data Custom s include data, company-specific text, or formatting Custom s require trigger and not in workflows
4
CONFIDENTIAL What is Velocity? Simplified language to reference objects in Java code Administrators customize dynamic content/outputs without access to main code base Contained within messages, Velocity provides detailed items and quick links back to system Functional and attractive templates created by combining Velocity and HTML
5
Settings CONFIDENTIAL ***This requires a Tomcat restart in order to start working!***
6
Example Use Case Configuration does not require Message entity
CONFIDENTIAL Example Use Case Sample Lot (Plasmid Lot) Request address attribute Trigger Impl (code that sends ) Employee (Requestor) Configuration does not require Message entity
7
CONFIDENTIAL Setting Up Request
8
Your Turn Set up REQUEST Entity Type Requirements, include:
CONFIDENTIAL Your Turn Set up REQUEST Entity Type Use REQUEST Super Type Requirements, include: Attribute to hold address Association to Plasmid Lot Association to Employee
9
Trigger Configuration
CONFIDENTIAL Trigger Configuration Take closer look at each attribute
10
CONFIDENTIAL Class Attributes Implementation Class and Trigger Type set by default to above values
11
CONFIDENTIAL Action Type Attribute Action Type tells trigger when to fire and send message Normal Action Types On_Create On_Update On_Publish
12
CONFIDENTIAL Traversal Attribute Use to send information from any Entity Types in message Allows for information to get to users without need to log to LIMS
13
Email Attribute Traversal must include “RECIPIENTS” variable
CONFIDENTIAL Attribute Traversal must include “RECIPIENTS” variable Traversal tells to go to Employee Association and send to their address, designated in Address Attribute
14
CONFIDENTIAL External s You can people outside of your organization as well You need to define an attribute that holds the external address in the Entity type In this case it is “ Group”, you will only need to tell the trigger that the recipient is in this entity
15
Velocity Body Attribute
CONFIDENTIAL Velocity Body Attribute
16
CONFIDENTIAL Velocity in the Each velocity statement should be designated as $REQUESTOR[0].name Since it can act like a list [#] is required Ability to go across entity types to show information
17
Common Variables Entity Object Available Variables Description
CONFIDENTIAL Common Variables Entity Object Available Variables Description This Entity $this[0].name Get name of Entity type that trigger is on $this[0].barcode Get barcode of Entity type that trigger is on $this[0].getCreationDate() Get date created of Entity type that trigger is on $this[0].getPublishDate() Get date published of Entity type that trigger is on $this[0].getValue("attribute name") Get attribute on Entity type that trigger is on
18
Velocity in the Email Send link in text back to system
CONFIDENTIAL Velocity in the Send link in text back to system Change second highlight to what you want it to say in First highlight to be changed when you set it in your system
19
Your Turn Create new EMAILTRIGGER
CONFIDENTIAL Your Turn Create new TRIGGER Add in traversal and Velocity body you would like to see in your
20
CONFIDENTIAL Attaching the Trigger Go to your Request Super type and select triggers for your Entity type
21
CONFIDENTIAL Attaching the Trigger Pick your trigger under Action type you selected for Add triggers in order you want them to fire
22
CONFIDENTIAL Final
23
CONFIDENTIAL More Complex Examples
24
CONFIDENTIAL Just More Velocity…
25
Getting Lot Information
CONFIDENTIAL Getting Lot Information <table style="width: 500px; height: 82px;"> <thead> <tr style="vertical-align: top; font-size: 16px;"> <td><b><u>LOT ID</u></b></td> <td><b><u>Quantity to Send(mg)</u></b></td> </tr> </thead> <tbody> #foreach($data in $ExperimentSamples) <tr style="vertical-align: top; font-size: 14px;"> <td>$data.getValue("LOT")</td> <td>$data.getValue("Quantity to Send_ci")</td> #end </tbody> </table>
26
Tools HTML Cleaner- Makes your life easy! http://www.html-cleaner.com
CONFIDENTIAL Tools HTML Cleaner- Makes your life easy! W3 School- Helps with HTML formatting tips
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.