This commit is contained in:
parent
b313ffc66a
commit
389ad95efd
2 changed files with 6 additions and 3 deletions
|
@ -5,6 +5,7 @@ import * as fs from 'fs';
|
||||||
interface Config {
|
interface Config {
|
||||||
daysInterval: number;
|
daysInterval: number;
|
||||||
timeOfDay: string;
|
timeOfDay: string;
|
||||||
|
emailReceiver: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Node structure for the Parse Tree (it's a degenerated tree with one or zero children per node)
|
// Node structure for the Parse Tree (it's a degenerated tree with one or zero children per node)
|
||||||
|
@ -79,7 +80,8 @@ 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: "Christopher.Hase@telekom.com;test@mailhog.local",
|
//to: "test@mailhog.local", //config
|
||||||
|
to: config.emailReceiver,
|
||||||
subject: "Your Horoscope Is Ready",
|
subject: "Your Horoscope Is Ready",
|
||||||
text: content,
|
text: content,
|
||||||
html: html(content)
|
html: html(content)
|
||||||
|
@ -215,7 +217,7 @@ function render(node: Node): string {
|
||||||
const regex = new RegExp("~", "g");
|
const regex = new RegExp("~", "g");
|
||||||
node.value = node.value?.replace(regex, "");
|
node.value = node.value?.replace(regex, "");
|
||||||
//outputHTML = "<br><p><div style=\"border: 1px dashed gray; border-radius: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; width: auto; display: inline-block; color: gray; text-align: center; box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);\">" + node.value + "</div></p><br>";
|
//outputHTML = "<br><p><div style=\"border: 1px dashed gray; border-radius: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; width: auto; display: inline-block; color: gray; text-align: center; box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);\">" + node.value + "</div></p><br>";
|
||||||
outputHTML = "<br><br><p><div style=\"padding-left: 20px; padding-right: 20px; padding-top: 20px; padding-bottom: 10px; display: inline-block; color: gray; text-align: center;\">" + node.value + "</div></p><br>";
|
outputHTML = "<br><br><p><div style=\"padding-left: 20px; padding-right: 20px; padding-top: 20px; display: inline-block; color: gray; text-align: center;\">" + node.value + "</div></p><br>";
|
||||||
outputHTML = outputHTML + render(node.child!);
|
outputHTML = outputHTML + render(node.child!);
|
||||||
|
|
||||||
return outputHTML;
|
return outputHTML;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
"daysInterval": 2,
|
"daysInterval": 2,
|
||||||
"timeOfDay": "8:00"
|
"timeOfDay": "8:00",
|
||||||
|
"emailReceiver": "test2@mailhog.local"
|
||||||
}
|
}
|
Loading…
Reference in a new issue