fix(medusa-plugin-sendgrid): decorate order placed data for email

This commit is contained in:
Sebastian Rindom committed 2020-08-28 15:38:18 +02:00
1 parent ee80cfe145
commit 2edf152c8e
2 files changed
+82 -4

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
# medusa-plugin-sendgrid
Sendgrid Plugin for Medusa to send transactional emails.
If no values are defined for a given option, the plugin will not try to send an email for that event.
## Plugin Options
```
{
api_key: [your sendgrid api key] (required),
from: [the from field, i.e. ACME <acme@mail.com>] (required),
gift_card_created_template: [used on gift_card.created],
order_placed_template: [used on order.placed],
order_cancelled_template: [used on order.cancelled],
order_completed_template: [used on order.completed],
user_password_reset_template: [used on user.password_reset],
customer_password_reset_template: [used on customer.password_reset]
}
```
## Dynamic usage
You can resolve the SendGrid service to dynamically send emails via sendgrid.
Example:
```js
const sendgridService = scope.resolve("sendgridService")
sendgridService.sendEmail("d-123....", "ACME <acme@mail.com>", "customer@mail.com", { dynamic: "data" })
```