Skip to main content
Version: Next

Email definition

The email engine is the tool AWE provides to define email structures with the application parameters and variables.

Emails are sent using the send-email operation inside a target from maintains.

info

Note: All emails are defined in the Email.xml file at global folder. View project structure for more info.

XML email structure

The email structure is the following:

  <email id="[email_name]">
<from query="[query_to_retrieve_data]" label="[label_column_on_query]" value="[value_column_on_query]" />
<to query="[query_to_retrieve_data]" label="[label_column_on_query]" value="[value_column_on_query]" />
<cc query="[query_to_retrieve_data]" label="[label_column_on_query]" value="[value_column_on_query]" />
<cco query="[query_to_retrieve_data]" label="[label_column_on_query]" value="[value_column_on_query]" />
<subject label="[locale_with_subject]" />
<body label="EMAIL_MESSAGE_HTML_HEADER" type="html" />
<body label="[locale_with_body_in_html]" type="html" />
<body label="EMAIL_MESSAGE_HTML_BOTTOM" type="html" />
<body label="[locale_with_body_in_plain_text]" type="text" />
<attachment value="PdfNam" label="EMAIL_FILE_PDF" />
<attachment value="DocNam" label="EMAIL_FILE_DOC" />
<attachment value="XlsNam" label="EMAIL_FILE_XLS" />
<attachment value="CsvNam" label="EMAIL_FILE_CSV" />
<attachment value="TxtNam" label="EMAIL_FILE_TXT" />
<variable id="ScrTit" type="STRING" name="ScrTit"/>
<variable id="ScrTitFil" type="STRING" name="ScrTitFil"/>
<variable id="PdfNam" type="STRING" name="PdfNam" optional="true"/>
<variable id="DocNam" type="STRING" name="DocNam" optional="true"/>
<variable id="XlsNam" type="STRING" name="XlsNam" optional="true"/>
<variable id="CsvNam" type="STRING" name="CsvNam" optional="true"/>
<variable id="TxtNam" type="STRING" name="TxtNam" optional="true"/>
</email>
ElementUseMultiples instancesDescription
emailRequiredNoIt describe the name of email
from*RequiredNoSource of the email
toRequiredNoTarget destination of the email
ccOptionalNoTarget copy
ccoOptionalNoTarget hidden copy
subjectRequiredNoEmail title
bodyRequiredYesEmail body
attachmentOptionalYesEmail attachments
variableOptionalYesAre parameters passed to email and wildcards

Wildcards

To allow multiple possibilities when generating emails, there is a wildcard format to allow inserting variable values into locales.

The wildcard format is the following:

[#VariableId#]

For example, in the following locale:

<locale name="EMAIL_FILE_PDF" value="[#ScrTitFil#].pdf"/>

ScrTitFil will be replaced with the variable with id ScrTitFil.

Special variables

There is a variable called user that, when it's sent to the email engine, it will use that variable to find the email server for that user and use it to send the email. If it's not defined, the session user will be used to find the email server.

info

Note: If there is no session and no user variable, then the default email server will be used to send the email.