Documentation
Feedback
Guides
API Reference

Guides
Master DataMaster Data v2Sending emails with triggers in Master Data v2
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

FieldTypeDescriptionRequired
typeStringAction type, which must be email.True
providerStringMessage Center provider name (usually named as default).True
fromObjectInformation about the sender.True
↪ emailStringSender email.True
↪ nameStringSender name.True
toArray of stringsList of recipient email addresses, separated by comma.True
replyToArrayEmail address for replies.True
subjectStringEmail subject.True
bodyStringEmail message body.True
bccArray of stringsList of email addresses that will receive a blind carbon copy (BCC) of the message.False

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
"bcc": [ "testbcc@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

FieldTypeDescriptionRequired
typeStringAction type, which must be t-email.True
templateStringName of the Message Center template.True
providerStringMessage Center provider name (usually named as default).True
fromObjectInformation about the sender.True
↪ emailStringSender email.True
↪ nameStringSender name.True
toArray of stringsList of recipient email addresses, separated by comma.True
replyToStringEmail address for replies.True
subjectStringEmail subjec.tTrue
bodyStringEmail message body.True
bccArray of stringsList of email addresses that will receive a blind carbon copy (BCC) of the message.False

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
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 3 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
3
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 3 contributors
On this page