Back to Website
Show / Hide Table of Contents

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 current item's fields of the project contain an Email field filled during project creation, it can be written as {{project.items.@.fields.Email}}.

  • subject (string) - Email subject. Interpolation is available.

  • body (string) - Email body. Interpolation is available.

  • useHtmlBody (boolean) - If true, 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 the body. 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>&bull; <a href=\"$$url$$\">$$name$$</a></span><br>"
    • Example 2: "bodyLinksItemTemplate" : "Link to download file $$name$$: $$url$$\"
  • bodyLinksItemUrlPlaceholder (string) - A marker for inserting the link. Default is "$$url$$". Only works within bodyLinksItemTemplate.

  • bodyLinksItemNamePlaceholder (string) - A marker for inserting the name. Default is "$$name$$". Only works within bodyLinksItemTemplate.

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.@.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>&bull; <a href=\"$$url$$\">$$name$$</a></span><br>",
        "bodyLinksItemNamePlaceholder" : "$$name$$",
        "bodyLinksItemUrlPlaceholder" : "$$url$$",
        "bodyLinksPlaceholder" : "$$links$$"
    }
}
Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2024 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback