mirror of
https://github.com/wassname/talk.git
synced 2026-07-15 11:26:58 +08:00
Merge branch 'master' into bugfix-for-permalink-path
This commit is contained in:
@@ -6,6 +6,7 @@ dist/coral-admin/bundle.js
|
||||
tests/e2e/reports
|
||||
.DS_Store
|
||||
*.iml
|
||||
*.swp
|
||||
dump.rdb
|
||||
.env
|
||||
gaba.cfg
|
||||
|
||||
+29
-3
@@ -1,10 +1,36 @@
|
||||
const nodemailer = require('nodemailer');
|
||||
|
||||
if (!process.env.TALK_SMTP_CONNECTION_URL) {
|
||||
console.error('TALK_SMTP_CONNECTION_URL should be defined if you would like to send password reset emails from Talk');
|
||||
const smtpRequiredProps = [
|
||||
'TALK_SMTP_USERNAME',
|
||||
'TALK_SMTP_PASSWORD',
|
||||
'TALK_SMTP_PROVIDER'
|
||||
];
|
||||
|
||||
smtpRequiredProps.forEach(prop => {
|
||||
if (!process.env[prop]) {
|
||||
console.error(`process.env.${prop} should be defined if you would like to send password reset emails from Talk`);
|
||||
}
|
||||
});
|
||||
|
||||
const options = {
|
||||
// list of providers here:
|
||||
// https://github.com/nodemailer/nodemailer-wellknown#supported-services
|
||||
service: process.env.TALK_SMTP_PROVIDER,
|
||||
auth: {
|
||||
user: process.env.TALK_SMTP_USERNAME,
|
||||
pass: process.env.TALK_SMTP_PASSWORD
|
||||
}
|
||||
};
|
||||
|
||||
if (process.env.TALK_SMTP_PORT) {
|
||||
options.port = process.env.TALK_SMTP_PORT;
|
||||
}
|
||||
|
||||
const defaultTransporter = nodemailer.createTransport(process.env.TALK_SMTP_CONNECTION_URL);
|
||||
if (process.env.TALK_SMTP_HOST) {
|
||||
options.host = process.env.TALK_SMTP_HOST;
|
||||
}
|
||||
|
||||
const defaultTransporter = nodemailer.createTransport(options);
|
||||
|
||||
const mailer = {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user