From 389ad95efd1644ae4e78d7a0ddf3d620ef322225 Mon Sep 17 00:00:00 2001
From: Christopher Hase
Date: Mon, 31 Mar 2025 10:14:08 +0200
Subject: [PATCH] more config part 1
---
broker.ts | 6 ++++--
config.json | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/broker.ts b/broker.ts
index 0d79c58..cccb9cb 100644
--- a/broker.ts
+++ b/broker.ts
@@ -5,6 +5,7 @@ import * as fs from 'fs';
interface Config {
daysInterval: number;
timeOfDay: string;
+ emailReceiver: string;
}
// 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 {
const info = await transporter.sendMail({
from: '"The Oracle" ',
- to: "Christopher.Hase@telekom.com;test@mailhog.local",
+ //to: "test@mailhog.local", //config
+ to: config.emailReceiver,
subject: "Your Horoscope Is Ready",
text: content,
html: html(content)
@@ -215,7 +217,7 @@ function render(node: Node): string {
const regex = new RegExp("~", "g");
node.value = node.value?.replace(regex, "");
//outputHTML = "
" + node.value + "
";
- outputHTML = "
" + node.value + "
";
+ outputHTML = "
" + node.value + "
";
outputHTML = outputHTML + render(node.child!);
return outputHTML;
diff --git a/config.json b/config.json
index 5b54a20..4ad956a 100644
--- a/config.json
+++ b/config.json
@@ -1,4 +1,5 @@
{
"daysInterval": 2,
- "timeOfDay": "8:00"
+ "timeOfDay": "8:00",
+ "emailReceiver": "test2@mailhog.local"
}
\ No newline at end of file