Files
medusa-store/packages/medusa-plugin-sendgrid
Sebastian Rindom 7308946e56 feat: notifications (#172)
The Notifications API allows plugins to register Notification Providers which have `sendNotification` and `resendNotification`.

Each plugin can listen to any events transmittet over the event bus and the result of the notification send will be persisted in the database to allow for clear communications timeline + ability to resend notifications.
2021-02-15 11:59:37 +01:00
..
2021-02-15 11:59:37 +01:00
2020-07-03 18:00:54 +02:00
2020-07-03 18:00:54 +02:00
2020-07-03 18:00:54 +02:00
2020-07-03 18:00:54 +02:00
2021-02-03 09:54:27 +01:00
2020-07-03 18:00:54 +02:00
2020-07-03 18:00:54 +02:00
2021-02-03 09:54:27 +01:00
2020-07-03 18:00:54 +02:00

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_shipped_template: [used on order.shipment_created],
  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:


const sendgridService = scope.resolve("sendgridService")
sendgridService.sendEmail("d-123....", "ACME <acme@mail.com>", "customer@mail.com", { dynamic: "data" })