npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

medusa-plugin-brevo

v0.0.28

Published

Brevo notification provider for Medusa

Downloads

265

Readme

Medusa Plugin Brevo

  1. Create an account at Brevo
  2. Create a new template and get the template id

1. Install

npm install medusa-plugin-brevo

2. Configuration

Add the following to your medusa-config.js:

module.exports = {
  //...
  plugins: [
    {
      resolve: 'medusa-plugin-brevo',
      options: {
        api_key: process.env.BREVO_API_KEY,
        from: {
            name: "Sender Name",
            email: "[email protected]"
        },
        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: "[email protected]",
        },
        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: "[email protected]",
            },
            {
                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

order.placed

type Parameters = {
    email: string
    order: {
        shipping_total
        discount_total
        tax_total
        refunded_total
        gift_card_total
        subtotal
        total
        customer_id
        customer

    },
    locale: string,
    has_discounts: boolean,
    has_gift_cards: boolean,
    date: string,
    items: {
        title: string
        description: string
        quantity: number
        product_id: string
        variant_id: string
        unit_price: number
        totals: LineItemTotals
        thumbnail: string
        discounted_price: string // Human readable
        price: string // Human readable
    }[]
}