1.0.0 • Published 4 years ago

strapi-provider-email-aws-sdk-ses v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

strapi-provider-email-aws-sdk-ses

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

Benefits

Version

  • Strapi 3.0.0-beta support

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