Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/derrickmehaffy/strapi-testing-email-lifecycles
Just a test application showing how you can send emails in lifecycles
https://github.com/derrickmehaffy/strapi-testing-email-lifecycles
Last synced: 2 days ago
JSON representation
Just a test application showing how you can send emails in lifecycles
- Host: GitHub
- URL: https://github.com/derrickmehaffy/strapi-testing-email-lifecycles
- Owner: derrickmehaffy
- Created: 2021-06-23T17:59:26.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-23T18:04:38.000Z (over 3 years ago)
- Last Synced: 2024-10-16T07:21:19.860Z (22 days ago)
- Language: JavaScript
- Size: 186 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sample Email lifecycle
This is a sample Strapi application showing how you can send emails when there are new, updated, or deleted entries from the Admin panel. **Note this logic will send the email on end-user requests but the fields used in the subject for first + last name will not be populated**
Key files:
- [Global Email function](./config/functions/sendEmail.js) => Used to easily send emails anywhere in the Strapi application
- [Environment variables for storing SendGrid information](./.env.example) => this should be copied to a `.env` file (which isn't sourced controlled)
- [Email provider settings](./config/plugins.js) => Used to configure your email provider, in this example I used sendgrid
- [Lifecycle Functions for the Article Model](./api/article/models/article.js) => Very basic example using just normal text (instead of HTML) in the afterCreate, afterUpdate, and afterDelete.For specifics on sending email I would advise you review our documentation for the email plugin:
https://strapi.io/documentation/developer-docs/latest/development/plugins/email.html#email
Specifically using email templates:
https://strapi.io/documentation/developer-docs/latest/development/plugins/email.html#send-an-email-using-a-template-sendtemplatedemail