Documentation
Feedback
Guides
API Reference

Guides
Master Datav2 Guides
Sending emails with triggers in Master Data v2

There are two ways of sending emails automatically with Master Data v2 triggers:

Learn more about triggers in the article Setting up triggers in Master Data v2.

Sending emails

This is the more direct method of sending emails with Master Data v2 triggers, but without the standardization provided by Message Center templates.

Properties

FieldTypeDescription
type*StringThe action type must be email
provider*StringMessage Center provider name (usually named as default)
from*ObjectName and email address of sender
to*ArrayList of emails that email will be sended
replyTo*ArrayEmail address for replies
subject*StringEmail subject
body*StringEmail message body
bccArrayList of email addresses that will receive a blind carbon copy (BCC) of the message

Dynamic expressions

You can use dynamic expressions to deal with document properties in these settings. For more information, look at the Article on dynamic expressions.

JSON Schema example


_18
{
_18
"properties": { ... },
_18
"v-triggers": [
_18
{
_18
"type": "email",
_18
"provider": "default",
_18
"subject": "Sending email with VTEX Master Data",
_18
"from": {
_18
"email": "mailfrom@email.com",
_18
"name": "My custom name"
_18
},
_18
"to": [ "test@test.com" ],
_18
"cco": [ "testcco@test.com" ],
_18
"replyTo": "noreply@email.com",
_18
"body": "VTEX Master Data Triggers email body"
_18
}
_18
]
_18
}

Sending emails using Message Center templates

See below how to set up a trigger to send emails using a Message Center template.

Properties

FieldTypeDescription
type*StringThe action type must be t-email
template*StringName of the Message Center template
provider*StringMessage Center provider name (usually named as default)
fromObjectName and email address of sender
to*ArrayList of email addresses to send the email
replyTo*StringEmail address for replies
subject*StringEmail subject
body*StringEmail message body
bccArrayList of email addresses that will receive a blind carbon copy (BCC) of the message

JSON Schema example


_29
{
_29
"properties": { ... },
_29
"v-triggers" [
_29
{
_29
"type": "t-email",
_29
"template": "template-name",
_29
"provider": "default",
_29
"subject": "My template email with VTEX Master Data",
_29
"to": [
_29
"{!email}",
_29
"test@email.com"
_29
],
_29
"bcc": [
_29
"myemail@test.com"
_29
],
_29
"replyTo": "noreply@company.com",
_29
"body": {
_29
"firstName": "{firstName}",
_29
"email": "{email}",
_29
"id": "{!id}",
_29
"clientName": "{!clientProfileData.firstName{!clientProfileData.lastName}",
_29
"ownerListName": "{!customData.customApps[0fields.ownerListName}",
_29
"ownerListEmail": "{!customData.customApps[0fields.ownerListEmail}",
_29
"items": "{!items}",
_29
"openTextField": "{!openTextField.value}"
_29
}
_29
}
_29
]
_29
}

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page