strapi-provider-email-aws-sdk-ses

1.0.0 • Public • Published

strapi-provider-email-aws-sdk-ses

Amazon Simple Email Service provider based on AWS SDK for Strapi Email Plugin.

Benefits

Installation

npm install strapi-provider-email-aws-sdk-ses

Programmatic usage

'use strict';

/**
 * `Emails` service.
 */


module.exports = {
  send: async () => {

    const options = {
      to: 'somebody@example.com',
      from: 'sender@example.com',
      replyTo: 'no-reply@example.com',
      subject: 'Use strapi email provider successfully',
      text: 'Hello world!',
      html: 'Hello world!',
    };

    // Retrieve provider configuration.
    const config = await strapi.store({
      environment: strapi.config.environment,
      type: 'plugin',
      name: 'email'
    }).get({ key: 'provider' });

    // Verify if the file email is enable.
    if (config.enabled === false) {
      strapi.log.error('Email is disabled');
      return false;
    }

    return await strapi.plugins.email.services.email.send(options, config);
  }

};

Configure the plugin

Resources

Links

Package Sidebar

Install

npm i strapi-provider-email-aws-sdk-ses

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

7.17 kB

Total Files

5

Last publish

Collaborators

  • bashconsole