Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

payload-email-azure

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

payload-email-azure

Payload Azure Email Adapter

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-33.33%
Maintainers
0
Weekly downloads
 
Created
Source

Azure Email Communication Services Adapter

This adapter allows you to send emails using Azure Email Communication Services

Installation

pnpm add payload-email-azure

Prerequesites

  1. An Azure account with an active subscription.
  2. An Azure Email Communication Services resource created and ready with a provisioned domain.
  3. An active Azure Communication Services resource connected to an Email Domain and its connection string. Get started by connecting an Email Communication Resource with a Azure Communication Resource
import { azureEmailAdapter } from "payload-email-azure";

export default buildConfig({
  email: azureEmailAdapter({
    defaultFromAddress: "DoNotReply@notify.example.com",
    connectionString: process.env.AZURE_EMAIL_CONNECTION_STRING,
  }),
});

Note: The defaultFromAddress must match one of the pre-configured EmailFrom addresses in your Azure Communication Service resource.

Authentication

There are a few different options available for authenticating an email client with Azure.

Using Connection String

import { azureEmailAdapter } from "payload-email-azure";

export default buildConfig({
  email: azureEmailAdapter({
    defaultFromAddress: "noreply@notify.example.com",
    connectionString: process.env.AZURE_EMAIL_CONNECTION_STRING,
  }),
});

Using Microsoft Entra ID

You may also choose to authenticate with Microsoft Entra ID using the @azure/identity package.

import { azureEmailAdapter } from "payload-email-azure";
import { DefaultAzureCredential } from "@azure/identity";

export default buildConfig({
  email: azureEmailAdapter({
    defaultFromAddress: "noreply@notify.example.com",
    endpoint: process.env.AZURE_EMAIL_ENDPOINT,
    // The DefaultAzureCredential uses the following environment variables:
    // AZURE_CLIENT_SECRET, AZURE_CLIENT_ID and AZURE_TENANT_ID
    credential: new DefaultAzureCredential(),
  }),
});

Using Azure Key Credentials

You can also choose to authenticate the email client using an AzureKeyCredential. Both the key and the endpoint can be founded on the "Keys" pane under "Settings" in your Communication Services Resource.

import { azureEmailAdapter } from "payload-email-azure";
import { AzureKeyCredential } from "@azure/core-auth";

export default buildConfig({
  email: azureEmailAdapter({
    defaultFromAddress: "noreply@notify.example.com",
    endpoint: process.env.AZURE_EMAIL_ENDPOINT,
    credential: new AzureKeyCredential(process.env.AZURE_EMAIL_KEY),
  }),
});

Keywords

FAQs

Package last updated on 25 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc