Send Email

ID: sendEmail

Sends an email to a recipient. To send an email using this action, it is required that you identify:

  1. the email provider to be used to send the email (applicationId and emailProviderId
  2. the recipient of the email (using to or toPrincipalId)
  3. who the email is from (either using from or the default from value of your email provider)
  4. the body of the email (by either specifying body directly, via a node reference or via an Email Template reference)
  5. the subject of the email

All other properties are optional.

Configuration

Here is a full breakdown of the configuration properties:

The Email Provider

In order to send emails, you first have to identify the Email Provider to be used in sending any emails. An Email Provider is configured on an application basis. Thus, different mobile or web or tenant applications can have entirely different email configurations (this can be very useful and enables you to redeploy email templates quickly from one project to the next).

Property Type Required Default Description
applicationId text true The ID of the application data store that holds the reference to the email provider.
emailProviderId text true The ID of the email provider.

The Recipient

You specify who receives the email either by plugging in an email address for the to field or by supplying the toPrincipalId (principal ID) of the Domain User receiving the email. The email address of the recipient will be used automatically.

Property Type Required Default Description
to text true The email address of the email recipient
toPrincipalId text false As an alternative to the to field, allows you to specify the principal ID of the domain user to receive the email. The email field will be used from the domain user to determine the recipient address.

Who it is From

There are two ways to specify who the email is from. If you've set the from field on the email provider, then this will be used automatically. In which case, you don't need to do anything else. In many cases, a single email provider will have a common and consistent from address. Thus, this helps so that you don't need to fill it in over and over again.

That said, if you want to specify the from address each time, you do so by just plugging it in.

Property Type Required Default Description
from text true The email address of the email sender. If an email provider is being used, the from property of the email provider will be used if nothing is provided here.

The Body of the Email

The body of the email is required. There are three ways to specify it:

  • With a straight up text string in the body property.
  • By referencing a node's attachment.
  • By referencing an email template.

Here are the properties:

Property Type Required Default Description
body text false The body of the email. (Method #1)
bodyRepositoryId text false The ID of the repository containing the node whose attachment contains the body of the email (Method #2).
bodyBranchId text false The ID of the branch containing the node whose attachment contains the body of the email (Method #2).
bodyNodeId text false The ID of the node whose attachment contains the body of the email (Method #2).
bodyAttachmentId text false The attachment ID on the node that holds the body of the email (Method #2).
templateRepositoryId text false The ID of the repository containing the email template (Method #3).
templateBranchId text false The ID of the branch containing the email template (Method #3).
templateKey text false The key of the email template (Method #3).

The Subject and optional properties

The only other required property is the subject. Everything else is optional as per listed here:

Property Type Required Default Description
subject text true The subject of the email.
cc text false A comma-delimited carbon copy (CC) list of recipient email addresses.
bcc text false A comma-delimited blind carbon copy (BCC) list of recipient email addresses.
replyTo text false The email address to serve as a reply to address.
repositoryId text false The ID of the repository containing a node (which binds into the model as node).
branchId text false The ID of the branch containing a node (which binds into the model as node).
nodeId text false The ID of the node (which binds into the model as node).