Built by
emilianscheelCategory
NotificationVersion
0.0.28
Last updated
Sep 15, 2024, 06:40:15 AM3 months agoMedusa Plugin Brevo
- Create an account at Brevo
- Create a new template and get the template id
1. Install
1npm install medusa-plugin-brevo
2. Configuration
Add the following to your Copy to clipboard
medusa-config.js
:123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158module.exports = {//...plugins: [{resolve: 'medusa-plugin-brevo',options: {api_key: process.env.BREVO_API_KEY,from: {name: "Sender Name",email: "info@example.com"},template_map: {"order.placed": 21}}}]}{resolve: `medusa-plugin-brevo`,/** @type {import('medusa-plugin-brevo').BrevoServiceOptions} */options: {api_key: process.env.BREVO_API_KEY,from: {name: "La Place Store",email: "info@la-place.store",},events: [{event: "user.created",template_id: 21,email: "auto",},{event: "user.updated",template_id: 21,email: "auto",},{event: "customer.created",template_id: 21,email: "auto",},{event: "customer.updated",template_id: 21,email: "auto",},{event: "customer.password_reset",template_id: 21,email: "auto",},{event: "invite.created",template_id: 21,email: "auto",},{event: "estock-notification.restocked",template_id: 21,email: "auto",},{event: "user.created",template_id: 21,email: "auto",},{event: "order.placed",template_id: 21,email: "auto",copy_to: "test7@la-place.site",},{event: "order.updated",template_id: 21,email: "auto",},{event: "order.canceled",template_id: 21,email: "auto",},{event: "order.completed",template_id: 21,email: "auto",},{event: "order.orders_claimed",template_id: 21,email: "auto",},{event: "order.refund_created",template_id: 21,email: "auto",},{event: "order.payment_captured",template_id: 21,email: "auto",},{event: "order.payment_capture_failed",template_id: 21,email: "auto",},{event: "claim.shipment_created",template_id: 21,email: "auto",},{event: "swap.created",template_id: 21,email: "auto",},{event: "swap.received",template_id: 21,email: "auto",},{event: "swap.shipment_created",template_id: 21,email: "auto",},{event: "order.fulfillment_created",template_id: 21,email: "auto",},{event: "order.fulfillment_canceled",template_id: 21,email: "auto",},{event: "swap.shipment_created",template_id: 21,email: "auto",},{event: "gift_card.created",template_id: 21,email: "auto",},{event: "gift_card.created",template_id: 21,email: "auto",},],},},
3. Test
Place an order.
Event E-Mail Parameters
Copy to clipboardorder.placed
12345678910111213141516171819202122232425262728293031type Parameters = {email: stringorder: {shipping_totaldiscount_totaltax_totalrefunded_totalgift_card_totalsubtotaltotalcustomer_idcustomer},locale: string,has_discounts: boolean,has_gift_cards: boolean,date: string,items: {title: stringdescription: stringquantity: numberproduct_id: stringvariant_id: stringunit_price: numbertotals: LineItemTotalsthumbnail: stringdiscounted_price: string // Human readableprice: string // Human readable}[]}