create html part 1

This commit is contained in:
Christopher Hase 2025-03-26 15:21:12 +01:00
parent 0c32957d7f
commit 4a654d0b94
2 changed files with 24 additions and 18 deletions

View file

@ -40,7 +40,8 @@ async function sendEmail(content: string) {
to: "Christopher.Hase@telekom.com;test@mailhog.local",
subject: "Horoscope from MailHog",
text: content,
html: "<p> ${content} </p>"
//html: "<p> ${content} </p>"
html: html(content)
});
console.log("E-Mail sent: ", info.messageId);
@ -49,7 +50,7 @@ async function sendEmail(content: string) {
}
}
//Sleep. To avoid: Completed -> Terminated -> CrashLoopBackOff
//Sleep. To avoid issue in pod: Completed -> Terminated -> CrashLoopBackOff
async function sleep() {
console.log("Go to sleep: ", new Date().toISOString());
@ -58,4 +59,24 @@ async function sleep() {
sleep(); // recursion after 1h
}, 3600000);
}
function html(input: string): string {
// Zerlege den String in einzelne Zeilen
const lines = input.split("\n");
// Bearbeite jede Zeile (z.B. trimme Leerzeichen und füge einen Prefix hinzu)
const processedLines = lines.map(line => `> ${line.trim()}`);
// Füge die Zeilen wieder zu einem String zusammen
return processedLines.join("\n");
}
//TODO: process every line...
function processLine(input: string): string {
return "";
}

View file

@ -15,19 +15,4 @@ spec:
containers:
- image: forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/iching-broker:main
name: iching-broker
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 40
periodSeconds: 25
timeoutSeconds: 15
failureThreshold: 3
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 30
periodSeconds: 20
timeoutSeconds: 13
successThreshold: 2