This commit is contained in:
parent
3855d5befc
commit
db846c890e
2 changed files with 3 additions and 8 deletions
|
@ -48,17 +48,13 @@ function executeCommand(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`Send E-Mail`);
|
console.log(`Send E-Mail`);
|
||||||
|
|
||||||
sendEmail(stdout);
|
sendEmail(stdout);
|
||||||
|
|
||||||
console.log(config.daysInterval, config.timeOfDay);
|
|
||||||
|
|
||||||
// Calculate next execution time
|
// Calculate next execution time
|
||||||
const nextRunDate = calculateNextRunDate(config.daysInterval, config.timeOfDay);
|
const nextRunDate = calculateNextRunDate(config.daysInterval, config.timeOfDay);
|
||||||
//console.log(`Gegenwärtig: ` + new Date());
|
|
||||||
console.log(`Next execution: ${nextRunDate}`);
|
console.log(`Next execution: ${nextRunDate}`);
|
||||||
|
|
||||||
//Start Scheduling
|
// Start Scheduling
|
||||||
scheduleNextRun(nextRunDate);
|
scheduleNextRun(nextRunDate);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -80,7 +76,6 @@ async function sendEmail(content: string) {
|
||||||
try {
|
try {
|
||||||
const info = await transporter.sendMail({
|
const info = await transporter.sendMail({
|
||||||
from: '"The Oracle" <the.oracle@holy.mountain>',
|
from: '"The Oracle" <the.oracle@holy.mountain>',
|
||||||
//to: "test@mailhog.local", //config
|
|
||||||
to: config.emailReceiver,
|
to: config.emailReceiver,
|
||||||
subject: "Your Horoscope Is Ready",
|
subject: "Your Horoscope Is Ready",
|
||||||
text: content,
|
text: content,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"daysInterval": 2,
|
"daysInterval": 2,
|
||||||
"timeOfDay": "8:00",
|
"timeOfDay": "8:00",
|
||||||
"emailReceiver": "test2@mailhog.local"
|
"emailReceiver": "test@mailhog.local"
|
||||||
}
|
}
|
Loading…
Reference in a new issue