EmailTemplate
You can use this function for Optiva Workflows and Functions.
Purpose
Returns a new object called EmailTemplateText
.
Syntax
Function EmailTemplate(template As String, ParamArray args() As String) As EmailTemplateText
Arguments
Argument | Description |
---|---|
template |
Using the Email Template form, the system administrator can create the message in plain text format or HTML format. |
ParamArray |
Custom parameters included in the message. Include local or global variables as parameters in the notify message. In the template code, refer to the variable as [%n] , where n is the number of the custom parameter. |
Description
The EmailTemplateText
object will have the Subject, Message and IsHtml properties filled in with the fully updated and token replacements of the requested template. This is equivalent to calling the Optiva Notify
method in regards to filling out of the email template. This allows the script to then use the SendMail
method instead where you can pass the Subject, Message and IsHtml arguments from the EmailTemplateText
object. Previously, SendMail
did not allow for email templates like Notify
does, and Notify
did not allow for file attachments. Using the EmailTemplate
method allows for email templates and file attachments.
You can use the class
EmailTemplateText
with the following properties:
Public Property IsHtml As Boolean
Public Property Message As String
Public Property Subject As String
To use the
EmailTemplateText
class in your script, add the following to the list of Imports at the top of the script:
Imports Formation.Shared.Defs