green-fox-academy / hotel-booking-notification-service

0 stars 0 forks source link

Send templated mail #29

Open zspadar opened 7 years ago

zspadar commented 7 years ago

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 """