✨(backend) add field for button label in email template (#1817)
## 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
This commit is contained in:
@@ -20,6 +20,7 @@ and this project adheres to
|
|||||||
|
|
||||||
- ♿(frontend) improve accessibility:
|
- ♿(frontend) improve accessibility:
|
||||||
- ♿️(frontend) fix subdoc opening and emoji pick focus #1745
|
- ♿️(frontend) fix subdoc opening and emoji pick focus #1745
|
||||||
|
- ✨(backend) add field for button label in email template #1817
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
Declare and configure the models for the impress core application
|
Declare and configure the models for the impress core application
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# pylint: disable=too-many-lines
|
# pylint: disable=too-many-lines
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
@@ -824,7 +825,8 @@ class Document(MP_Node, BaseModel):
|
|||||||
"document": self,
|
"document": self,
|
||||||
"domain": domain,
|
"domain": domain,
|
||||||
"link": f"{domain}/docs/{self.id}/",
|
"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,
|
"logo_img": settings.EMAIL_LOGO_IMG,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<!-- Main Message -->
|
<!-- Main Message -->
|
||||||
<mj-text>
|
<mj-text>
|
||||||
{{message|capfirst}}
|
{{message|capfirst}}
|
||||||
<a href="{{link}}">{{document_title}}</a>
|
<a href="{{link}}">{{link_label}}</a>
|
||||||
</mj-text>
|
</mj-text>
|
||||||
<mj-button
|
<mj-button
|
||||||
href="{{link}}"
|
href="{{link}}"
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
color="white"
|
color="white"
|
||||||
padding-bottom="30px"
|
padding-bottom="30px"
|
||||||
>
|
>
|
||||||
{% trans "Open"%}
|
{{button_label}}
|
||||||
</mj-button>
|
</mj-button>
|
||||||
<mj-divider
|
<mj-divider
|
||||||
border-width="1px"
|
border-width="1px"
|
||||||
|
|||||||
Reference in New Issue
Block a user