feat: Add ability to configure and test SMTP via UI

This commit is contained in:
Maksim Eltyshev
2025-09-22 20:35:13 +02:00
parent 3a12bb7457
commit c6f4dcdb70
114 changed files with 2161 additions and 301 deletions

View File

@@ -5,6 +5,10 @@
module.exports = {
inputs: {
transporter: {
type: 'ref',
required: true,
},
to: {
type: 'string',
required: true,
@@ -20,13 +24,8 @@ module.exports = {
},
async fn(inputs) {
const transporter = sails.hooks.smtp.getTransporter(); // TODO: check if enabled?
try {
const info = await transporter.sendMail({
...inputs,
from: sails.config.custom.smtpFrom,
});
const info = await inputs.transporter.sendMail(inputs);
sails.log.info(`Email sent: ${info.messageId}`);
} catch (error) {