diff --git a/broker.ts b/broker.ts index 0e2652f..353864b 100644 --- a/broker.ts +++ b/broker.ts @@ -40,7 +40,8 @@ async function sendEmail(content: string) { to: "Christopher.Hase@telekom.com;test@mailhog.local", subject: "Horoscope from MailHog", text: content, - html: "
${content}
" + //html: "${content}
" + 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 ""; +} \ No newline at end of file diff --git a/deployment.yaml b/deployment.yaml index 540e0a3..5de5897 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -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 +