1.0.7 • Published 1 year ago
strapi-plugin-email-collect v1.0.7
Strapi Email Sending Collect Plugin

Prerequisites
Install the @strapi/provider-email-nodemailer plugin
yarn add @strapi/provider-email-nodemailerConfigure 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"), }, }, }, });Install the strapi-plugin-email-designer plugin
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", + ], + }, + }, + }, + }, // ...Install the strapi-plugin-email-collect plugin
yarn add strapi-plugin-email-collectRestart the Strapi service
yarn build yarn develop
Usage
Send emails to users
Create an email template in the admin panel Get the
templateReferenceId
Send an email Set the
templateReferenceIdto the corresponding template id, it must be a number `
Only collect emails without sending them
- Set the
templateReferenceIdto String Type