CoolMail
Version
Version | Date | Change |
2.0 | 12.11.18 | Pre-requisite Checker |
1.1 | 20.12.17 | Added debug and Optional fromName and fromMail |
1.0 | 21.09.17 | Initial Web published version |
0.x | 06.03.16 | Initial version with CookBook |
Highlights
- Use preformatted HTML or plaintext email Templates
- Easy to use
- Replace {tags} in the Mail template with vRO values
- Repeats HTML structures and fills them either with values from arrays or from properties.
- Use a configuration to centrally store your mail settings
Description
The coolMail subsystem works by substituting a tag with an vRO value. A coolMail tag can be freely defined and must have { } winged brackets around it. For example {vm.name} or {userName}.
The User just prepares a HTML template (e.g. using html-online.com) and inserts tags where later values from vRO should be displayed. This enables one for example to create very nice looking HTML email that can be used with vRealize Automation (vRA).
Varibales
The input to CoolMail is a property which is defined as:
Property Key Name |
Type |
Required |
||||||
mailTo | string (multiple Email addresses with comma speration) | yes | ||||||
mailCC | string (multiple Email addresses with comma speration) | no | ||||||
mailBCC | string (multiple Email addresses with comma speration) | no | ||||||
subject |
String (can contain {tags} ) |
yes |
||||||
mailTemplate |
Resource Element |
yes |
||||||
fromMail |
Sting |
no |
||||||
fromName |
Sting |
no |
||||||
mailReplacements |
subValue:
|
no |
The variable subject can also contain {tags} to be replaced.
HowTo
Installation and configuration
- Import the vRO package into your vRO appliance
- Run the workflow configure CoolMail
The configuration program will ask for all the required information to establish a SMTP connection between vRO and a Mail server. The configuration is saved in a Configuration file and a test email can be sent to check if the SMTP configuration is working.
All configurations are stored in Configurations: vleet | coolmail.conf
The example will ask for your name, some other input as well as an array of Strings. It will then use an example mail template to send an email.
Basic Usage
1. Create a HTML email template (see example beneath)
<html> |
2. Save the HTML email as a text file and upload it into vRO as an resource element
3. Create a new workflow
4. Add the coolMail Subsystem workflow
5. Create an attribute of type ResoruceElement and link it to the mail template you have uploaded
6. Use a Scriptable task with an OUT-attribute of type Properties, called mailPayload.
7. In the scriptable task define the mailPayload (see example beneath)
var mailPayload= new Properties(); |
8. Pass the mailPayload to the coolMail Subsystem workflow
8. Run the workflow
Repeat lines
You can use arrays or properties to repeat HTML code.
You need to encase the structure you would like to repeat with the HTML comment
<!--{TAG.start}--> and
<!--{TAG.end} -->
where TAG is the replacement tag name you
want to use.
For Arrays you can use {TAG.counter} to display the counter (starting at 0) and {TAG.value} will contain the value of the array for the given counter. If you use {TAG.counter1} instead the counting will start at 1. Mixing the Tags will result in nonsence output.
For Properties you can use {TAG.name} to display the Property key and {TAG.value} to display the Property value of a given key. Both Tags must be strings.
Examples:
|
Array |
Properties |
HTML Source Code |
<!--{repeat.start}--> |
<!--{plugins.start}--> |
vRO code |
var repeatArray=new Array(); |
var propertyValues=new Properties(); |
HTML output |
<tr> |
<tr> |
Replace images
You can also use Cool mail to replace images. You do that by exchanging the content of the HTML <img> tag with a image location.
HTML Source Code |
<img src="{ImageSource}" /> |
vRO code |
mailReplacements.put("ImageSource",”http://langenhan.info/images/object0.png”); |
HTML output |
<img src="http://langenhan.info/images/object0.png" /> |
Package content
This Package contains three workflows:
- The CoolMail Subsystem workflow
- The CoolMail configuration workflow
- and an example workflow
Dowload Links:
The following Software is distributed under the GNU General Public License, which allows you to use, copy, modify and distribute (keeping my name as Author). If you modify the programm,please let me know and share your ideas.
TheSoftware is written for vRealize Ochrestrator and works with Version 5.5 or better