mirror of
https://github.com/tomru/wichteln.git
synced 2026-03-03 06:27:15 +01:00
further work
This commit is contained in:
15
wichteln.js
15
wichteln.js
@@ -11,11 +11,12 @@ const mailer = nodemailer.createTransport({
|
||||
});
|
||||
|
||||
function mail(email, name, pick) {
|
||||
mailer.sendMail({
|
||||
from: 'ido@cassiopeia.uberspace.com',
|
||||
to: email,
|
||||
subject: `Dein Wichtel ${name} ist ...`,
|
||||
text: `Hey ${name},
|
||||
mailer.sendMail(
|
||||
{
|
||||
from: "tomru@uber.space",
|
||||
to: email,
|
||||
subject: `Dein Wichtel ${name} ist ...`,
|
||||
text: `Hey ${name},
|
||||
|
||||
Dein Wichtel ist *trommelwirbel*
|
||||
|
||||
@@ -85,6 +86,10 @@ const run = async () => {
|
||||
people.map(({ name, pick }) => `${name} picked ${pick}`).join("\n")
|
||||
);
|
||||
|
||||
if (dryRun) {
|
||||
console.log("DryRun: did not send emails");
|
||||
return;
|
||||
}
|
||||
people.forEach(p => mail(p.email, p.name, p.pick));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user