diff --git a/serwer/app/func.js b/serwer/app/func.js index 642d3bf..bcd08a1 100644 --- a/serwer/app/func.js +++ b/serwer/app/func.js @@ -454,6 +454,38 @@ CREATE OR REPLACE VIEW \`sumy\` AS SELECT \`rozliczenie\`.\`wolontariuszID\` AS return toSend; } +function massEmail($emaile = [], $tytul = "Powiadomienie od sztabu", $tresc = "Brak treści wiadomości") +{ + const nodemailer = require('nodemailer'); + const transporter = nodemailer.createTransport({ + host: process.env.SMTPHOST, + port: process.env.SMTPPORT, + secure: true, + auth: { + user: process.env.SMTPLOGIN, + pass: process.env.SMTPPASS + } + }); + $emaile.forEach(element => { + const mailOptions = { + from: process.env.SMTPLOGIN, + bcc: element, + subject: $tytul, + html: '
Pozdrawiamy,
' + process.env.SZTAB + '