We are often asked for various processes for sending an SMS/email to the end user. The DynamicSender can very often handle this. Maybe the request for the communication is already in a workflow, then this component can just be plugged in and configured.
In situations where we do not control the process in a workflow, the Java code must be changed. The developer can insert a call to a hookpoint for a little "communication" workflow where the DynamicSender can be used.
So what are the possibilities in the DynamicSender - please check the topics below.
Possibilities
Configuration options:
- Define specific template
- Define SMS or email
- Replacing of "not handled" labels
- Define a fixed receiver SMS phone number or email address
- Define fixed strings for labels
- Define how data should be retrieved via navigation logic
- Handling of attachments for emails Several "helpers" available:
- DateUtil for easy access to date features like formatting
- NumberUtil for easy access to number features like formatting + checking/validating
- CommonUtils for easy access to various helper methods On top of this, you can also use the template context framework. Just note that only some basic objects (SUB, USER, SERVICE, BG, ACCOUNT) are available.
Prerequisites
Basic (1.th) version:
|
Fully updated version:
|
Common:
|
Getting started
This is an example of how it could be configured.
A demo workflow where SUBSCRIPTION + INVOICE objects are added to the wf CONTEXT when the hookpoint is called.
- The JavaScript wf component locates a file and adds it to the workflow CONTEXT.
- Next the DynamicSender will find the file in wf CONTEXT and attach it in the email to the end user.
The DynamicSender is configured like this:
PARAMETER |
DESCRIPTION |
---|---|
TEMPLATE_KEY=MY_TEMPLATE |
Defines the MailTemplate to use |
TEMPLATE_TYPE=EMAIL |
Defines that the DynamicSender should generate an email |
REPLACE_EMPTY_LABELS=TRUE |
Setting this to true means that not handled labels will never be shown as **LABEL@MY_LABEL**, but will become an empty string |
TEMPLATE_TO="aa@bb.cc" |
An email address speficied in double quotes, means that the default receiver (sub.getOwner().getEmail()) will be overruled |
LABEL_WEB_ADR="www.mywebsite.com" |
This label with a fixed value can be be reused several plced in the template. |
LABEL_PIN_CODE=SUBSCRIPTION.getService.getSimCard.getPin1 |
This label can be used in the template for showing the PIN code for the simcard |
WORK_SIGNUP_DATE=SUBSCRIPTION.getEstablishDate |
Tmp object that holds the signup date (used later) |
WORK_DATE_FORMAT=dd-MM-yyyy |
Tmp object that holds a date format (used later) |
LABEL_SIGNUP_DATE=DATE_UTIL.getFormatedDate(WORK_SIGNUP_DATE,WORK_DATE_FORMAT) |
Producing a label with signup date in format dd-MM-yyyy |
WORK_BOOLEAN=true |
Tmp object that holds a boolean (used later) |
CONDITION_IS_TEST=COMMON_UTIL.getBoolean(WORK_BOOLEAN) |
A condition that can be used in the template |
WORK_DOC_CODE=INVOICE |
Tmp object that holds the type of item in DOC_ARCHIVE (used later) |
ATTACHMENT_INVOICE=INVOICE.getDocArchive(WORK_DOC_CODE).getDocArchiveFile |
Locate a PDF file from the DocArchive based on an invoice found in wf CONTEXT |
ATTACHMENT_SOME_FILE="C:/rator/files/somefile.txt" |
Locate a file placed on C drive, which will also be an attachment in the email |
|
Visualization |
---|
What the MailTemplate could contain:
|