strapi-plugin-email-collect

1.0.7 • Public • Published

Strapi Email Sending Collect Plugin

npm package version npm package daily downloads github stars github issues main workflow

Collect Email List

Prerequisites

  1. Install the @strapi/provider-email-nodemailer plugin

    Documentation

    yarn add @strapi/provider-email-nodemailer
  2. Configure email sending parameters

    # file location .env
    SMTP_HOST=smtpdm.aliyun.com
    SMTP_PORT=465
    SMTP_USERNAME=luca.li@test.com #'luca <luca.li@test.com>'
    SMTP_PASSWORD=123456
    // file location config/plugins.ts
    module.exports = ({ env }) => ({
      email: {
        config: {
          provider: "nodemailer",
          providerOptions: {
            host: env("SMTP_HOST", "smtp.example.com"),
            port: env("SMTP_PORT", 587),
            auth: {
              user: env("SMTP_USERNAME"),
              pass: env("SMTP_PASSWORD"),
            },
            // ... any custom nodemailer options
          },
          settings: {
            defaultFrom: env("SMTP_USERNAME"),
            defaultReplyTo: env("SMTP_USERNAME"),
          },
        },
      },
    });
  3. Install the strapi-plugin-email-designer plugin

    Documentation

    yarn add strapi-plugin-email-designer@latest
    //file location config/middlewares.js
    - "strapi::security",
    + {
    +     name: "strapi::security",
    +     config: {
    +       contentSecurityPolicy: {
    +         directives: {
    +           "script-src": ["'self'", "editor.unlayer.com"],
    +           "frame-src": ["'self'", "editor.unlayer.com"],
    +           "img-src": [
    +             "'self'",
    +             "data:",
    +             "cdn.jsdelivr.net",
    +             "strapi.io",
    +             "s3.amazonaws.com",
    +           ],
    +         },
    +       },
    +     },
    +   },
    // ...
  4. Install the strapi-plugin-email-collect plugin

    yarn add strapi-plugin-email-collect
  5. Restart the Strapi service

    yarn build
    yarn develop

Usage

Send emails to users

  1. Create an email template in the admin panel Get the templateReferenceId Email Template

  2. Send an email Set the templateReferenceId to the corresponding template id, it must be a number ` Send Email

Only collect emails without sending them

  1. Set the templateReferenceId to String Type Collect Email

Package Sidebar

Install

npm i strapi-plugin-email-collect

Weekly Downloads

0

Version

1.0.7

License

MIT

Unpacked Size

18.7 kB

Total Files

28

Last publish

Collaborators

  • lich0320