1.0.7 • Published 12 months ago

strapi-plugin-email-collect v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

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