|
@@ -80,10 +80,12 @@ class MailService extends S2sMessageHandlable {
|
|
|
// Priority 1. SMTP
|
|
// Priority 1. SMTP
|
|
|
if (configManager.getConfig('crowi', 'mail:smtpHost') && configManager.getConfig('crowi', 'mail:smtpPort')) {
|
|
if (configManager.getConfig('crowi', 'mail:smtpHost') && configManager.getConfig('crowi', 'mail:smtpPort')) {
|
|
|
this.mailer = this.createSMTPClient();
|
|
this.mailer = this.createSMTPClient();
|
|
|
|
|
+ this.isMailerSetup = true;
|
|
|
}
|
|
}
|
|
|
// Priority 2. SES
|
|
// Priority 2. SES
|
|
|
else if (configManager.getConfig('crowi', 'mail:sesAccessKeyId') && configManager.getConfig('crowi', 'mail:sesSecretAccessKey')) {
|
|
else if (configManager.getConfig('crowi', 'mail:sesAccessKeyId') && configManager.getConfig('crowi', 'mail:sesSecretAccessKey')) {
|
|
|
this.mailer = this.createSESClient();
|
|
this.mailer = this.createSESClient();
|
|
|
|
|
+ this.isMailerSetup = true;
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
this.mailer = null;
|
|
this.mailer = null;
|
|
@@ -120,7 +122,6 @@ class MailService extends S2sMessageHandlable {
|
|
|
const client = nodemailer.createTransport(option);
|
|
const client = nodemailer.createTransport(option);
|
|
|
|
|
|
|
|
logger.debug('mailer set up for SMTP', client);
|
|
logger.debug('mailer set up for SMTP', client);
|
|
|
- this.isMailerSetup = true;
|
|
|
|
|
|
|
|
|
|
return client;
|
|
return client;
|
|
|
}
|
|
}
|
|
@@ -139,7 +140,6 @@ class MailService extends S2sMessageHandlable {
|
|
|
const client = nodemailer.createTransport(ses(option));
|
|
const client = nodemailer.createTransport(ses(option));
|
|
|
|
|
|
|
|
logger.debug('mailer set up for SES', client);
|
|
logger.debug('mailer set up for SES', client);
|
|
|
- this.isMailerSetup = true;
|
|
|
|
|
|
|
|
|
|
return client;
|
|
return client;
|
|
|
}
|
|
}
|