Sending an email (bizzstream.sendMail)
You can use bizzstream.sendMail to send an email.
bizzStream.sendMail({options})
Parameter | Type | Required | Description |
---|---|---|---|
documentId | String | Yes | The id of the document that should be sent. |
subject | String | Yes | This is the subject line of an Email. BizzStream Expressions such as {!placeholder!} are allowed. |
content | String | Yes | The name of the template that is used to generate the e-mail. |
from | String | No | This is the e-mail address from which you send the e-mail. Only verified e-mail addresses can be used. |
attachmentNames | Array | No | An array of the names of the PDF templates that are attached to the e-mail. |
recipientAccessGroupNames | Array | No | An array with the names of the access groups that should receive the e-mail. |
otherRecipients | String | No | This is where you can create a list of Email addresses when you want to send the Email to a person that is not assigned to an access group. All Email addresses have to be separated by a comma. You may use BizzStream expressions in this field. |
attachmentFieldNames | Array | No | An array of attachment header field names whose attachments you want attached to the e-mail. |
Example
bizzStream.sendMail({
documentId: 'd2DR7beWx5KZijf4o',
subject: 'An e-mail from BizzStream',
content: 'order',
from: 'contact@bizzstream.com',
attachmentNames: ['order'],
recipientAccessGroupNames: ['chiefs'],
otherRecipients: 'support@bizzstream.com, info@bizzstream.com',
attachmentFieldNames: ['picture']
})