Create an endpoint that sends an email based on a template.
Feature: Registration email
Scenario: Send registration email
Given the application running
Given an email template in the database:
| fields | id | en-text |
| ["name", "id"] | 1 | "Hi ${mame}, your id: ${id}" |
When the '/send/1' endpoint is requested with a 'POST' request with data like:
"""
{
"data": {
"type": "email",
"attributes": {
"email": "john.doe@example.org",
"fields": [
"name": "John",
"id": 1
],
"language": "en"
}
}
}
"""
Then it should send an email to 'john.doe@example.org':
"""
Hi John, your id: 1
"""
Send templated mail
Create an endpoint that sends an email based on a template.
Feature: Registration email
Scenario: Send registration email Given the application running Given an email template in the database: | fields | id | en-text | | ["name", "id"] | 1 | "Hi ${mame}, your id: ${id}" | When the '/send/1' endpoint is requested with a 'POST' request with data like: """ { "data": { "type": "email", "attributes": { "email": "john.doe@example.org", "fields": [ "name": "John", "id": 1 ], "language": "en" } } } """ Then it should send an email to 'john.doe@example.org': """ Hi John, your id: 1 """