From 668d7cd40451e3c070936e67a2a7e07de55faf25 Mon Sep 17 00:00:00 2001 From: Sylvain Boissel Date: Tue, 20 Jan 2026 12:03:54 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(backend)=20add=20field=20for=20button?= =?UTF-8?q?=20label=20in=20email=20template=20(#1817)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Purpose The email template is made with the idea that they link to a document. This change allows to customize the label of the button (currently, "Open") to allow for a different action verb. Additionally, the 'document_title' parameter is renamed to 'link_label' to reflect that it can link to other things than documents. ## Proposal - [x] Email template `template.mjml` updated as proposed - [x] Method `send_email()` updated - [x] Translations updated --- CHANGELOG.md | 1 + src/backend/core/models.py | 4 +++- src/mail/mjml/template.mjml | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1903b43..bb4e3d53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to - ♿(frontend) improve accessibility: - ♿️(frontend) fix subdoc opening and emoji pick focus #1745 +- ✨(backend) add field for button label in email template #1817 ### Security diff --git a/src/backend/core/models.py b/src/backend/core/models.py index 453e683f..9f4e3721 100644 --- a/src/backend/core/models.py +++ b/src/backend/core/models.py @@ -1,6 +1,7 @@ """ Declare and configure the models for the impress core application """ + # pylint: disable=too-many-lines import hashlib @@ -824,7 +825,8 @@ class Document(MP_Node, BaseModel): "document": self, "domain": domain, "link": f"{domain}/docs/{self.id}/", - "document_title": self.title or str(_("Untitled Document")), + "link_label": self.title or str(_("Untitled Document")), + "button_label": _("Open"), "logo_img": settings.EMAIL_LOGO_IMG, } ) diff --git a/src/mail/mjml/template.mjml b/src/mail/mjml/template.mjml index 93fa89c6..a71409d4 100644 --- a/src/mail/mjml/template.mjml +++ b/src/mail/mjml/template.mjml @@ -22,7 +22,7 @@ {{message|capfirst}} - {{document_title}} + {{link_label}} - {% trans "Open"%} + {{button_label}} - + \ No newline at end of file