Software - Cool Mail
This Package will enable Aria Orchestrator to send HTML emails based on a template with exchangeable variables.
Aria Orchestrator is owned and licenced by VMware.
UPDATED VERSION 5.0 (27/02/24)
Features
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 store your mail settings centrally
can use attachment
The coolMail subsystem works by exchanging a tag in the preformatted HTML body with an Orchestrator variable. The name of a tag can be freely defined but must be enclosed by { } winged brackets. For example, {vm.name} or {userName}.
You can easily create an HTML template by using a free online HTML WYSIWYG editor like html-online.com.
Installation and configuration
Import the vRO package into your vRO appliance
Run the workflow configure CoolMail
Send test email
The workflow facilitates the setup of SMTP connections between Aria Orchestrator and a mail server on your website. Configuration details are stored in coolTools |
coolmailConf. Users input the required information, and the system tests the SMTP setup by sending a sample email using a predefined template.
Basic Usage
Create an HTML email template (see example beneath)
<html>
this is a test {vm.name}.
<table>
<tr><td>Name</td><td>{vm.name}</td></tr>
<tr><td>IP</td><td>{vm.ip}</td></tr>
<tr><td>Mac</td><td>{vm.mac}</td></tr>
</table>
</html>
Save the HTML email as a text file and upload it into vRO as a resource element
Create a new workflow
Add the coolMail Subsystem workflow
Create an attribute of type ResoruceElement and link it to the mail template you have uploaded.
Use a Scriptable task with an OUT-attribute of type Properties, called mailPayload.
In the scriptable task, define the mailPayload (see example beneath)
var mailPayload= new Properties();
mailPayload.put("mailTo","info@langenhan.info");
mailPayload.put("subject","Test email für {vm.name}");
mailPayload.put("mailTemplate",resourceElement);
var mailReplacements= new Properties();
mailReplacements.put("vm.name","myVM");
mailReplacements.put("vm.ip","192.168.220.10");
mailReplacements.put("vm.mac"," 0A:0B:0C:0D:0E:0F");
mailPayload.put("mailReplacements",mailReplacements);
Pass the mailPayload to the coolMail Subsystem workflow
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 nonsense output.
For Properties (with Strings), 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.
For Properties (with properties), you can use much more complex tables. (please see the example below as weel as the Example Email in the package)
Examples:
|
Array |
Properties (String) | Properties (Properties) |
HTML Source Code |
<!--{repeat.start}--> |
<!--{plugins.start}--> |
<!--{vms.start}--> |
vRO code |
var repeatArray=new Array(); |
var propertyValues=new Properties(); |
var vms=new Properties(); mailReplacements.put("vms",vms); |
HTML output |
<tr> |
<tr> |
<tr> |
Attachments
To attach an file to an email you simply have to pass the MimeAttachment to CoolMail. You can either upload one by simply adding an MimeAttachment into your Inputs or create one from scratch like this:
Example 1: JSON Attachment:
var attachment = new MimeAttachment();
attachment.content=JSON.stringify(jsonObject);
attachment.name="report.json";
attachment.mimeType="text/plain";
mailPayload.put("attachment",attachment);
Example 2: convert an ResourceElement:
var attachment = new MimeAttachment();
attachment.content=resourceElement.getContentAsMimeAttachment() ;
attachment.name=resourceElement.name;
attachment.mimeType=resourceElement.mimeType;
mailPayload.put("attachment",attachment);
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" /> |
Variables
The input parameter to CoolMail is a property that 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 |
||||||
testing |
boolean |
no |
||||||
attachment
|
MimeAttachment |
no |
||||||
mailReplacements
|
SubValue:
|
yes |
Change Log
Version | Date | Change |
5.0 | 27/02/24 |
Major updates and bug fixes. added featured:
|
4.0.1 | 28.11.23 | Minor Changes. Clean up file names |
4.0 | 02.07.23 | Minor Changes. New Business Name |
3.0 | 28.07.22 | converted to 8.x, general cleanup, added attachments |
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 |