diff --git a/app/services/newsletter.py b/app/services/newsletter.py index c31ab2a..d14fd37 100644 --- a/app/services/newsletter.py +++ b/app/services/newsletter.py @@ -231,6 +231,7 @@ def create_plain_text( "", ] ) + lines.extend(_plain_contact_line(contact_email)) highlight_articles = _match_highlights(new_articles + edited_articles, highlights) if highlight_articles: @@ -251,7 +252,7 @@ def create_plain_text( ] ) lines.extend(_plain_editor_tip(editor_tip)) - lines.append(_plain_footer(new_articles, edited_articles, contact_email)) + lines.append(_plain_footer(new_articles, edited_articles)) return "\n".join(lines).strip() if show_new: @@ -268,10 +269,19 @@ def create_plain_text( ) lines.append("") lines.extend(_plain_editor_tip(editor_tip)) - lines.append(_plain_footer(new_articles, edited_articles, contact_email)) + lines.append(_plain_footer(new_articles, edited_articles)) return "\n".join(lines).strip() +def _plain_contact_line(contact_email: str) -> list[str]: + if contact_email.strip(): + return [ + f"Fragen oder ein Themenwunsch? E-Mail an das Wiki-Team: {contact_email.strip()}", + "", + ] + return ["Fragen oder ein Themenwunsch? Meldet euch gern beim Wiki-Team.", ""] + + def _plain_editor_tip(editor_tip: str) -> list[str]: text = (editor_tip or "").strip() if not text: @@ -345,6 +355,12 @@ def create_html( else: contact_html = "Fragen oder ein Themenwunsch? Meldet euch gern beim Wiki-Team." + contact_section = ( + f'
{contact_html}
' + f"|
- {contact_html} Viele Grüße Euer Thomas-Krenn-Wiki Team |
@@ -739,17 +755,18 @@ def create_outlook_html(
editor_tip_row = _outlook_editor_tip(editor_tip)
if contact_email.strip():
- contact_inner = (
+ contact_block = (
+ f'
| - {contact_inner} - | -
{_outlook_font("Servus,")} {_outlook_font(f"hier ist deine Übersicht mit den neuesten Beiträgen aus dem Thomas-Krenn-Wiki vom {period_start} bis {period_end}.")} + {contact_block} {category_block} {highlights_rows}
|