-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
6 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,7 @@ module.exports = { | |
description: 'The mailer to used.', | ||
extendedDescription: | ||
'The mailer should be configured properly in config/mails.js. If not specified, the default mailer in sails.config.mail.default will be used', | ||
defaultsTo: | ||
sails.config.mailer || | ||
sails.config.mail.default || | ||
process.env.MAIL_MAILER | ||
defaultsTo: process.env.MAIL_MAILER || sails.config.mail.default | ||
}, | ||
template: { | ||
description: | ||
|
@@ -82,7 +79,8 @@ module.exports = { | |
'An override for the default "from" email that\'s been configured.', | ||
example: '[email protected]', | ||
isEmail: true, | ||
defaultsTo: sails.config.mail.from.address || process.env.MAIL_FROM_ADRESS | ||
defaultsTo: | ||
sails.config.mail.from.address || process.env.MAIL_FROM_ADDRESS | ||
}, | ||
|
||
fromName: { | ||
|
@@ -190,25 +188,18 @@ module.exports = { | |
const nodemailer = getModule('nodemailer') | ||
var transporter = nodemailer.createTransport({ | ||
host: | ||
sails.config[mailer]?.host || | ||
sails.config.mail.mailers[mailer]?.host || | ||
process.env.MAIL_HOST, | ||
sails.config.mail.mailers[mailer]?.host || process.env.MAIL_HOST, | ||
port: | ||
sails.config[mailer]?.port || | ||
sails.config.mail.mailers[mailer]?.port || | ||
process.env.MAIL_PORT, | ||
sails.config.mail.mailers[mailer]?.port || process.env.MAIL_PORT, | ||
secure: | ||
sails.config[mailer]?.secure || | ||
sails.config.mail.mailers[mailer]?.secure || | ||
process.env.MAIL_SECURE || | ||
false, | ||
auth: { | ||
user: | ||
sails.config[mailer]?.username || | ||
sails.config.mail.mailers[mailer]?.username || | ||
process.env.MAIL_USERNAME, | ||
pass: | ||
sails.config[mailer]?.password || | ||
sails.config.mail.mailers[mailer]?.password || | ||
process.env.MAIL_PASSWORD | ||
} | ||
|
@@ -232,7 +223,6 @@ module.exports = { | |
case 'resend': | ||
const { Resend } = getModule('resend') | ||
const apiKey = | ||
sails.config[mailer]?.apiKey || | ||
sails.config.mail.mailers[mailer]?.apiKey || | ||
process.env.RESEND_API_KEY | ||
const resend = new Resend(apiKey) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters