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

@yanotoma/strapi-provider-email-sendinblue

v1.1.0

Published

Sendinblue provider for strapi email

Downloads

45

Readme

strapi-provider-email-sendinblue

Resources

Links

Prerequisites

You need to have the plugin strapi-plugin-email installed in you Strapi project.

Installation

# using yarn
yarn add @yanotoma/strapi-provider-email-sendinblue

# using npm
npm install @yanotoma/strapi-provider-email-sendinblue --save

Configuration

package.json

Since the name of the package has an scope you have to add an alias.

replace <version> with the version you have installed. ex. npm:@yanotoma/[email protected]


  "dependencies": {
    ...
    "strapi-provider-email-sendinblue": "npm:@yanotoma/strapi-provider-email-sendinblue@<version>"
    ...
  }

Config params

| Variable | Type | Description | Required | Default | | ------------------------ | ------ | ------------------------------------------------- | -------- | --------- | | provider | string | The name of the provider you use | yes | | | providerOptions | object | Provider options | yes | | | providerOptions.apiKey | object | Api key given to the function setApiKey | yes | | | settings | object | Settings | no | {} | | settings.defaultFrom | string | Default sender mail address | no | undefined | | settings.defaultFromName | string | Default name of the sender | no | undefined | | settings.defaultReplyTo | string | Default address the receiver is asked to reply to | no | undefined |

Example

Path - config/plugins.js

module.exports = ({ env }) => ({
  // ...
  email: {
    provider: "sendinblue",
    providerOptions: {
      apiKey: env("SENDINBLUE_API_KEY"),
    },
    settings: {
      defaultFrom: "[email protected]",
      defaultFromName: "My name",
      defaultReplyTo: "[email protected]",
    },
  },
  // ...
});

Usage

Params

| Variable | Type | Description | Required | | ------------------ | -------- | -------------------------------------------------------- | -------------------------- | | to | string | address of the receiver | yes | | from | string | address of the sender | no | | fromName | string | anme of the sender | no | | replyTo | string | address the receiver is asked to reply to | no | | subject | string | subject of the email | yes | | html | string | html email body | if there is not templateId | | text | string | text email body | if there is not templateId | | templateId | number | id of the template created in Sendinblue | if there is not html | | params | object | params to tjat will override the template | no | | tags | string[] | array of string to add to the transactional email record | no | | contact | object | data to add or update a contact | no | | contact.email | string | address to add to the contacts list | yes | | contact.attributes | object | attributes to add with the email address | no |

Examples

// using html and text
const user = {
  name: 'Jhon Doe',
  email: '[email protected]',
};

const html = `<h1>Hello ${user.name}</h1>`;
const text = `Hello ${user.name}`

await strapi.plugins.email.services.email.send({
  to: user.email,
  subject: 'This is a test!'
  html,
  text,
  tags: ['test', 'hello']
});
// using template id
const user = {
  name: 'Jhon Doe',
  email: '[email protected]',
};


await strapi.plugins.email.services.email.send({
  to: user.email,
  subject: 'This is a test!'
  templateId: 1,
  params: user,
  tags: ['test', 'hello', 'template']
});
// adding a contact

// attributes may change depending on your configuration and language
const contact = {
  email: '[email protected]',
  attributes: {
    'FIRSTNAME': 'Jhon',
    'LASTNAME': 'Doe'
  }
};

const html = `<h1>Hello ${user.attributes.FIRSTNAME}</h1>`;
const text = `Hello ${user.attributes.FIRSTNAME}`

await strapi.plugins.email.services.email.send({
  to: user.email,
  subject: 'This is a test!'
  html,
  text,
  tags: ['test', 'hello'],
  contact
});