snapshot: preserve bilingual email template phase

This commit is contained in:
Md Bayazid Bostame
2026-03-24 12:37:35 +01:00
parent 4d3c7bdf6e
commit ec00ae8b2e
9 changed files with 275 additions and 18 deletions

View File

@@ -126,6 +126,8 @@ docker compose exec -T web django-admin compilemessages</code></pre>
<li>Do not use custom ad hoc <code>.mo</code> compilation anymore.</li>
<li>Phase 1 bilingual support covers fixed UI.</li>
<li>Phase 2 covers builder-driven labels and checklist items with explicit German and English fields.</li>
<li>Email phase covers <code>NotificationTemplate</code>, <code>NotificationRule</code>, and the welcome-email settings UI with explicit DE/EN subject/body fields.</li>
<li>Request records now persist <code>preferred_language</code> so workflow emails can render in the submitter's active UI language with German fallback.</li>
</ul>
<h2 id="pdf">7) PDF Pipeline</h2>
@@ -150,6 +152,8 @@ docker compose exec -T web django-admin compilemessages</code></pre>
<ul>
<li>Notification defaults are defined in <code>DEFAULT_NOTIFICATION_TEMPLATES</code> in <code>tasks.py</code>.</li>
<li>Admin-configured overrides live in <code>NotificationTemplate</code> and <code>NotificationRule</code>.</li>
<li>Both models now support explicit DE/EN content fields. Prefer filling both languages in the frontend integrations UI instead of embedding mixed-language copy into a single template.</li>
<li>Welcome-email configuration under Admin Apps has the same DE/EN split and follows the same runtime language selection.</li>
<li>Mail sending uses Celery tasks and supports test mode redirection.</li>
<li>MailHog is the local verification path when test mode is active.</li>
</ul>

View File

@@ -195,13 +195,21 @@
<p class="template-title">{{ tpl.get_key_display }} ({{ tpl.key }})</p>
<div class="grid">
<div>
<label for="subject_{{ tpl.key }}">Subject</label>
<label for="subject_{{ tpl.key }}">Subject (DE)</label>
<input id="subject_{{ tpl.key }}" name="subject_{{ tpl.key }}" value="{{ tpl.subject_template }}" />
</div>
<div>
<label for="body_{{ tpl.key }}">Body</label>
<label for="body_{{ tpl.key }}">Body (DE)</label>
<textarea id="body_{{ tpl.key }}" name="body_{{ tpl.key }}">{{ tpl.body_template }}</textarea>
</div>
<div>
<label for="subject_en_{{ tpl.key }}">Subject (EN)</label>
<input id="subject_en_{{ tpl.key }}" name="subject_en_{{ tpl.key }}" value="{{ tpl.subject_template_en }}" />
</div>
<div>
<label for="body_en_{{ tpl.key }}">Body (EN)</label>
<textarea id="body_en_{{ tpl.key }}" name="body_en_{{ tpl.key }}">{{ tpl.body_template_en }}</textarea>
</div>
</div>
</div>
{% endfor %}
@@ -269,6 +277,14 @@
<label for="custom_body_{{ rule.id }}">Custom Body (optional)</label>
<textarea id="custom_body_{{ rule.id }}" name="custom_body_{{ rule.id }}">{{ rule.custom_body }}</textarea>
</div>
<div>
<label for="custom_subject_en_{{ rule.id }}">Custom Subject (EN, optional)</label>
<input id="custom_subject_en_{{ rule.id }}" name="custom_subject_en_{{ rule.id }}" value="{{ rule.custom_subject_en }}" />
</div>
<div>
<label for="custom_body_en_{{ rule.id }}">Custom Body (EN, optional)</label>
<textarea id="custom_body_en_{{ rule.id }}" name="custom_body_en_{{ rule.id }}">{{ rule.custom_body_en }}</textarea>
</div>
</div>
<div class="check-row">
<label><input type="checkbox" name="active_{{ rule.id }}" {% if rule.is_active %}checked{% endif %} /> Aktiv</label>
@@ -332,6 +348,14 @@
<label for="new_custom_body">Custom Body (optional)</label>
<textarea id="new_custom_body" name="new_custom_body"></textarea>
</div>
<div>
<label for="new_custom_subject_en">Custom Subject (EN, optional)</label>
<input id="new_custom_subject_en" name="new_custom_subject_en" />
</div>
<div>
<label for="new_custom_body_en">Custom Body (EN, optional)</label>
<textarea id="new_custom_body_en" name="new_custom_body_en"></textarea>
</div>
</div>
<div class="check-row">
<label><input type="checkbox" name="new_include_pdf" /> PDF anhängen</label>

View File

@@ -166,8 +166,10 @@
<li><strong>Current scope:</strong> the core user interface supports German and English switching for the main fixed UI pages.</li>
<li><strong>Covered now:</strong> login, home, requests dashboard, onboarding form shell, offboarding form shell, and common status/messages in views.</li>
<li><strong>Phase 2 added:</strong> dynamic Form Builder option labels, field label/help-text overrides, and intro-builder checklist item labels now support German and English values.</li>
<li><strong>Email phase added:</strong> admin-managed notification template subject/body content, notification rule custom subject/body content, and welcome email subject/body content now support explicit DE/EN values.</li>
<li><strong>Runtime selection:</strong> onboarding and offboarding requests store the UI language at submission time, and notification delivery uses that language with German fallback.</li>
<li><strong>Editing path:</strong> these DE/EN values are maintained directly in the frontend builder pages, not only in Django admin.</li>
<li><strong>Not fully bilingual yet:</strong> admin-configured email templates and several generated PDF/business text blocks still remain primarily single-language.</li>
<li><strong>Not fully bilingual yet:</strong> several generated PDF/business text blocks still remain primarily single-language.</li>
<li><strong>Implementation:</strong> Django i18n with locale middleware, translation catalogs, and a DE/EN language switch in the main UI.</li>
</ul>

View File

@@ -68,13 +68,21 @@
<input id="welcome_sender_email" name="welcome_sender_email" type="email" value="{{ workflow_config.welcome_sender_email }}" placeholder="Leer = System-Absender" />
</div>
<div>
<label for="welcome_subject">Welcome Subject</label>
<label for="welcome_subject">Welcome Subject (DE)</label>
<input id="welcome_subject" name="welcome_subject" value="{{ welcome_subject_value }}" />
</div>
<div>
<label for="welcome_body">Welcome Text</label>
<label for="welcome_body">Welcome Text (DE)</label>
<textarea id="welcome_body" name="welcome_body">{{ welcome_body_value }}</textarea>
</div>
<div>
<label for="welcome_subject_en">Welcome Subject (EN)</label>
<input id="welcome_subject_en" name="welcome_subject_en" value="{{ welcome_subject_value_en }}" />
</div>
<div>
<label for="welcome_body_en">Welcome Text (EN)</label>
<textarea id="welcome_body_en" name="welcome_body_en">{{ welcome_body_value_en }}</textarea>
</div>
</div>
<div class="check-row">
<label><input type="checkbox" name="welcome_include_pdf" {% if workflow_config.welcome_include_pdf %}checked{% endif %} /> Onboarding-PDF anhängen</label>