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

strapi-provider-email-azure

v1.0.3

Published

Strapi Email provider for Azure Communication Service

Downloads

1,593

Readme

Strapi Email provider for Azure Communication Service

Installation

# using yarn
yarn add strapi-provider-email-azure

# using npm
npm install strapi-provider-email-azure --save

Then in your config/plugins.js:

module.exports = ({ env }) => ({
  // ...
  email: {
    config: {
      provider: 'strapi-provider-email-azure',
      providerOptions: {
        endpoint: env('AZURE_ENDPOINT'),
      },
      settings: {
        defaultFrom: env('FALLBACK_EMAIL'),
      },
    },
  },
  // ...
});

Usage

await strapi
  .plugin('email')
  .service('email')
  .send({
    from: process.env.EMAIL_SERVICE_ADDRESS,
    to: [
      {
        address: '[email protected]',
        displayName: 'Display Name',
      },
    ],
    subject: 'Hello world',
    text: 'Hello world',
  });

You can also leave the from field empty to send the email from the fallback address.

The following fields are supported:

| Field | Description | | ----------- | ----------------------------------------------------------------- | | from | Email address of the sender (string) | | to | Array of recipients (string | EmailAddress | Array<EmailAddress>) | | cc | Array of recipients who get cc (string | EmailAddress | Array<EmailAddress>) | | bcc | Array of recipients who get bcc (string | EmailAddress | Array<EmailAddress>) | | replyTo | Email address to which replies are sent (Array<EmailAddress>) | | subject | Subject of the email (string) | | text | Plaintext version of the message (string) | | html | HTML version of the message (string) | | attachments | Array of attachments (Array<Attachment>) | | disableUserEngagementTracking | Whether user engagement tracking should be disabled (boolean) | | headers | Custom email headers (Dictionary<string, string>) |

type EmailAddress {
    address: string,
    displayName: string
}
type Attachment {
    name: string,
    contentType: string,
    contentInBase64: string
}

For more information, please refer to @azure/communication-email documentations:

How to create Azure Communication Service

1. Create the Email Communications Service

  1. Navigate to the Azure portal to create a new resource
  2. Create Email Communication Services
  3. Complete the required information on the basics tab
  4. Review the resource details. Click Create
  5. Wait for the Deployment to complete

2. Create Communication Service

  1. Navigate to the Azure portal to create a new resource
  2. Create Communication Services
  3. Complete the required information on the basics tab
  4. Review the resource details. Click Create
  5. Wait for the Deployment to complete

3. Connect the services

  1. Go to your newly created Email Communcation Services resource, and navigate to Provision Domains
  2. Add a new Azure managed domain or Custom domain
  3. Go to your Communication Services resource, and navigate to Email/Domains
  4. Connect to the domain you created in you Email Communication Services resource

4. Acquire access endpoint key

  1. In your Communication Services resource, navigate to Settings/Keys
  2. Copy your Primary key/Connection string
  3. Store it in your environment variables
    AZURE_ENDPOINT=<connection_string>

5. (Optional) Create email addresses

  1. In your Email Communication Services resource, go to Provision Domains, and click on the name of your domain
  2. In Email services/MailFrom addresses you can create additional email addresses
  3. By default DoNotReply@yourdomain is created, and you can store it as the fallback email address of strapi-provider-email-azure in your environment variables
    FALLBACK_EMAIL=DoNotReply@yourdomain