send-email
- Last updated on December 29, 2023
- •
- 2 minutes to read
This task sends an email with the rendering results.
Parameters
Overriding parameters
The parameter group allows replacing the default settings in the base configuration. They may be required to send emails to customers using the tenant's SMTP server.
host
(string) - SMTP server host address.port
(number) - SMTP server port.account
(string) - Email account user.username
(string) - Username for accessing the account.password
(string) - Password for server access.useSsl
(boolean) - Access encryption mode.
Basic parameters
recipients
(string) - Comma-separated list of recipients. Value substitution from project parameters is available. For example, if the first item's fields of the project contain anEmail
field filled during project creation, it can be written as{{project.items.0.fields.Email}}
.subject
(string) - Email subject. Interpolation is available.body
(string) - Email body. Interpolation is available.useHtmlBody
(boolean) - Iftrue
, sends the email body as an HTML document.
Additional parameters
For building a list of artifacts, you can use interpolation "{{result:url}}"
, where "result"
is the artifact name from inputArtifacts
. If you need to display a list, use interpolation "{{images*:url}}"
, where "images"
is the name of the artifact collection. However, when using a collection, the links will be written in a line separated by commas. To solve this issue, use the following parameters.
bodyLinksPlaceholder
(string) - A marker for inserting the prepared list of download links for all artifacts passed to the task. This sequence is searched in thebody
. If found, it is replaced with the link list. The default marker is"$$links$$"
.bodyLinksItemTemplate
(string) - A template describing a single line from the link list. The template supports markers for the artifact file link (bodyLinksItemUrlPlaceholder
) and the artifact name (bodyLinksItemNamePlaceholder
).- Example 1:
"bodyLinksItemTemplate" : "<span>• <a href=\"$$url$$\">$$name$$</a></span><br>"
- Example 2:
"bodyLinksItemTemplate" : "Link to download file $$name$$: $$url$$\"
- Example 1:
bodyLinksItemUrlPlaceholder
(string) - A marker for inserting the link. Default is"$$url$$"
. Only works withinbodyLinksItemTemplate
.bodyLinksItemNamePlaceholder
(string) - A marker for inserting the name. Default is"$$name$$"
. Only works withinbodyLinksItemTemplate
.
These parameters support argument interpolation following the common rules.
Example
{
"description": "Send link to print file by email",
"name": "send email",
"type": "send-email",
"inputArtifacts": [ "result*" ],
"parameters": {
"host": "your-company-smtp-server.com",
"port": 587,
"account": "noreply@your-company.com",
"username": "noreply@your-company.com",
"password": "some-secret-password",
"useSsl": true,
"recipients": "first@example.com, another@example.com",
"subject": "Your print file {{project.items.0.fields.customName?}} is ready",
"body": "Greetings {{project.customerName}}. <br> You can download print file for your personalized product here: <br> $$links$$ <br>",
"useHtmlBody" : true,
"bodyLinksItemTemplate" : "<span>• <a href=\"$$url$$\">$$name$$</a></span><br>",
"bodyLinksItemNamePlaceholder" : "$$name$$",
"bodyLinksItemUrlPlaceholder" : "$$url$$",
"bodyLinksPlaceholder" : "$$links$$"
}
}