manager-bh/server/mailer.js
Primakov Alexandr Alexandrovich ef35a8aa6c init
2024-11-04 18:47:17 +03:00

17 lines
645 B
JavaScript

const { AdminNotificationRequest, addToQueue, configs, init } = require('@brojs/mailer');
const rc = require('./.serverrc');
const pkg = require('../package');
init({
userName: process.env.SMTP_MAIL_LOGIN,
password: process.env.SMTP_MAIL_PASSWORD,
adminMails: process.env.MAIL_TO_1,
smtpConfig: configs.yandex,
queTimer: rc.mailStepTimer,
});
if (process.env.MAIL_TO_1 && process.env.NODE_ENV === 'production') {
addToQueue(new AdminNotificationRequest(`Деплой kc админки v${pkg.version} прошёл успешно (${process.env.ADMIN_FRONT_BASE_NAME}) (Время ${new Date().toLocaleString()})`));
}