45 lines
859 B
JavaScript
Raw Normal View History

feat: maintain strapi-provider-email-nodemailer What does it do? ---------------- This will merge repository https://github.com/yutikom/strapi-provider-email-nodemailer/ into this mono repo under ``` packages/strapi-provider-email-nodemailer ``` Why is it needed? ----------------- In summer I opened [issue 6998](https://github.com/strapi/strapi/issues/6998) because I had a terrible developer experience from a multitude of unmaintained or outdated 3rd party libraries for email delivery through SMTP. As explained in the issue, we made `strapi-provider-email-nodemailer` compatible with version 3. I think the best idea would be to incorporate the library into the main strapi mono repository, so it does not get out of sync and stays maintained. Strapi is already maintaining several proprietary email providers including Mailgun, Sendgrid and Amazon: https://github.com/strapi/strapi/tree/master/packages So why not SMTP? SMTP is not proprietary and it's better for data privacy and GDPR. Developer experience gets improved because less headache but also because most people have an email account already. See the isssue for more details. Related issue(s)/PR(s) ---------------------- https://github.com/strapi/strapi/issues/6998 close #6998 Co-authored-by: Veit Bjarsch <vb@poweruplink.com> Co-authored-by: Saunved <saunved@gmail.com> Co-authored-by: Yurii Tykhomyrov <yurii.tykhomyrov@automat-it.com> Co-authored-by: Tymon Jakubowski <tymon.jakubowski@gmail.com> Signed-off-by: roschaefer <git@roschaefer.de>
2020-10-29 13:45:47 +01:00
'use strict';
/**
* Module dependencies
*/
const _ = require('lodash');
const nodemailer = require('nodemailer');
const emailFields = [
'from',
'replyTo',
'to',
'cc',
'bcc',
'subject',
'text',
'html',
'attachments',
];
feat: maintain strapi-provider-email-nodemailer What does it do? ---------------- This will merge repository https://github.com/yutikom/strapi-provider-email-nodemailer/ into this mono repo under ``` packages/strapi-provider-email-nodemailer ``` Why is it needed? ----------------- In summer I opened [issue 6998](https://github.com/strapi/strapi/issues/6998) because I had a terrible developer experience from a multitude of unmaintained or outdated 3rd party libraries for email delivery through SMTP. As explained in the issue, we made `strapi-provider-email-nodemailer` compatible with version 3. I think the best idea would be to incorporate the library into the main strapi mono repository, so it does not get out of sync and stays maintained. Strapi is already maintaining several proprietary email providers including Mailgun, Sendgrid and Amazon: https://github.com/strapi/strapi/tree/master/packages So why not SMTP? SMTP is not proprietary and it's better for data privacy and GDPR. Developer experience gets improved because less headache but also because most people have an email account already. See the isssue for more details. Related issue(s)/PR(s) ---------------------- https://github.com/strapi/strapi/issues/6998 close #6998 Co-authored-by: Veit Bjarsch <vb@poweruplink.com> Co-authored-by: Saunved <saunved@gmail.com> Co-authored-by: Yurii Tykhomyrov <yurii.tykhomyrov@automat-it.com> Co-authored-by: Tymon Jakubowski <tymon.jakubowski@gmail.com> Signed-off-by: roschaefer <git@roschaefer.de>
2020-10-29 13:45:47 +01:00
module.exports = {
provider: 'nodemailer',
name: 'Nodemailer',
init(providerOptions = {}, settings = {}) {
feat: maintain strapi-provider-email-nodemailer What does it do? ---------------- This will merge repository https://github.com/yutikom/strapi-provider-email-nodemailer/ into this mono repo under ``` packages/strapi-provider-email-nodemailer ``` Why is it needed? ----------------- In summer I opened [issue 6998](https://github.com/strapi/strapi/issues/6998) because I had a terrible developer experience from a multitude of unmaintained or outdated 3rd party libraries for email delivery through SMTP. As explained in the issue, we made `strapi-provider-email-nodemailer` compatible with version 3. I think the best idea would be to incorporate the library into the main strapi mono repository, so it does not get out of sync and stays maintained. Strapi is already maintaining several proprietary email providers including Mailgun, Sendgrid and Amazon: https://github.com/strapi/strapi/tree/master/packages So why not SMTP? SMTP is not proprietary and it's better for data privacy and GDPR. Developer experience gets improved because less headache but also because most people have an email account already. See the isssue for more details. Related issue(s)/PR(s) ---------------------- https://github.com/strapi/strapi/issues/6998 close #6998 Co-authored-by: Veit Bjarsch <vb@poweruplink.com> Co-authored-by: Saunved <saunved@gmail.com> Co-authored-by: Yurii Tykhomyrov <yurii.tykhomyrov@automat-it.com> Co-authored-by: Tymon Jakubowski <tymon.jakubowski@gmail.com> Signed-off-by: roschaefer <git@roschaefer.de>
2020-10-29 13:45:47 +01:00
const transporter = nodemailer.createTransport(providerOptions);
return {
send(options) {
// Default values.
const emailOptions = {
..._.pick(options, emailFields),
from: options.from || settings.defaultFrom,
replyTo: options.replyTo || settings.defaultReplyTo,
text: options.text || options.html,
html: options.html || options.text,
};
feat: maintain strapi-provider-email-nodemailer What does it do? ---------------- This will merge repository https://github.com/yutikom/strapi-provider-email-nodemailer/ into this mono repo under ``` packages/strapi-provider-email-nodemailer ``` Why is it needed? ----------------- In summer I opened [issue 6998](https://github.com/strapi/strapi/issues/6998) because I had a terrible developer experience from a multitude of unmaintained or outdated 3rd party libraries for email delivery through SMTP. As explained in the issue, we made `strapi-provider-email-nodemailer` compatible with version 3. I think the best idea would be to incorporate the library into the main strapi mono repository, so it does not get out of sync and stays maintained. Strapi is already maintaining several proprietary email providers including Mailgun, Sendgrid and Amazon: https://github.com/strapi/strapi/tree/master/packages So why not SMTP? SMTP is not proprietary and it's better for data privacy and GDPR. Developer experience gets improved because less headache but also because most people have an email account already. See the isssue for more details. Related issue(s)/PR(s) ---------------------- https://github.com/strapi/strapi/issues/6998 close #6998 Co-authored-by: Veit Bjarsch <vb@poweruplink.com> Co-authored-by: Saunved <saunved@gmail.com> Co-authored-by: Yurii Tykhomyrov <yurii.tykhomyrov@automat-it.com> Co-authored-by: Tymon Jakubowski <tymon.jakubowski@gmail.com> Signed-off-by: roschaefer <git@roschaefer.de>
2020-10-29 13:45:47 +01:00
return transporter.sendMail(emailOptions);
feat: maintain strapi-provider-email-nodemailer What does it do? ---------------- This will merge repository https://github.com/yutikom/strapi-provider-email-nodemailer/ into this mono repo under ``` packages/strapi-provider-email-nodemailer ``` Why is it needed? ----------------- In summer I opened [issue 6998](https://github.com/strapi/strapi/issues/6998) because I had a terrible developer experience from a multitude of unmaintained or outdated 3rd party libraries for email delivery through SMTP. As explained in the issue, we made `strapi-provider-email-nodemailer` compatible with version 3. I think the best idea would be to incorporate the library into the main strapi mono repository, so it does not get out of sync and stays maintained. Strapi is already maintaining several proprietary email providers including Mailgun, Sendgrid and Amazon: https://github.com/strapi/strapi/tree/master/packages So why not SMTP? SMTP is not proprietary and it's better for data privacy and GDPR. Developer experience gets improved because less headache but also because most people have an email account already. See the isssue for more details. Related issue(s)/PR(s) ---------------------- https://github.com/strapi/strapi/issues/6998 close #6998 Co-authored-by: Veit Bjarsch <vb@poweruplink.com> Co-authored-by: Saunved <saunved@gmail.com> Co-authored-by: Yurii Tykhomyrov <yurii.tykhomyrov@automat-it.com> Co-authored-by: Tymon Jakubowski <tymon.jakubowski@gmail.com> Signed-off-by: roschaefer <git@roschaefer.de>
2020-10-29 13:45:47 +01:00
},
};
},
};