Skip to content

Commit 4be22ff

Browse files
committed
Emails template
1 parent b6c6fd3 commit 4be22ff

File tree

8 files changed

+188
-37
lines changed

8 files changed

+188
-37
lines changed
Loading
Loading
33.8 KB
Loading

src/bundle/Resources/translations/ibexa_admin_ui.en.xliff

+25
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,31 @@
5656
<target state="new">Select language</target>
5757
<note>key: edit_translation.list.title</note>
5858
</trans-unit>
59+
<trans-unit id="e7b58c781e23a49ce354cdb479f14d6f75ca6e4f" resname="forgot_user_password.mail.message">
60+
<source>We have received a request to reset the password for your account. Click "reset password" below to choose a new password:</source>
61+
<target state="new">We have received a request to reset the password for your account. Click "reset password" below to choose a new password:</target>
62+
<note>key: forgot_user_password.mail.message</note>
63+
</trans-unit>
64+
<trans-unit id="26ccb574b6cd1e49d40d32d9183db89065138be2" resname="forgot_user_password.mail.message_footer">
65+
<source>If you did not request a password reset, please ignore this email, and your password will remain the same.</source>
66+
<target state="new">If you did not request a password reset, please ignore this email, and your password will remain the same.</target>
67+
<note>key: forgot_user_password.mail.message_footer</note>
68+
</trans-unit>
69+
<trans-unit id="a5ba92910b3dc61efc12c4f42cc869975be98723" resname="forgot_user_password.mail.message_title">
70+
<source>Hello,</source>
71+
<target state="new">Hello,</target>
72+
<note>key: forgot_user_password.mail.message_title</note>
73+
</trans-unit>
74+
<trans-unit id="b7293d1f766a95b50cf3e076c5ef4cd623dc542c" resname="forgot_user_password.mail.reset_password">
75+
<source>Reset password</source>
76+
<target state="new">Reset password</target>
77+
<note>key: forgot_user_password.mail.reset_password</note>
78+
</trans-unit>
79+
<trans-unit id="5fd68a8b7cdaa23771e0e970466b4432642df1d3" resname="forgot_user_password.mail.reset_your_password">
80+
<source>Reset your password</source>
81+
<target state="new">Reset your password</target>
82+
<note>key: forgot_user_password.mail.reset_your_password</note>
83+
</trans-unit>
5984
<trans-unit id="e4b8188e898e654dae14fc6b18133958f8e56084" resname="translation.remove.success">
6085
<source>Removed '%languageCode%' translation from '%name%'.</source>
6186
<target state="new">Removed '%languageCode%' translation from '%name%'.</target>

src/bundle/Resources/translations/messages.en.xliff

-22
Original file line numberDiff line numberDiff line change
@@ -366,28 +366,6 @@
366366
<target state="new">This email is connected with several accounts. Enter your login instead.</target>
367367
<note>key: ezplatform.forgot_user_password.login</note>
368368
</trans-unit>
369-
<trans-unit id="db6dd97ed4776bb0e9843554c48e3962327e8f50" resname="ezplatform.forgot_user_password.message">
370-
<source><![CDATA[Hi,
371-
<br /><br />
372-
We have received a request to reset the password for your Ibexa DXP account. Click “reset password” below to choose a new password:
373-
<br /><br />
374-
<a href="%reset_password%">Reset password</a>
375-
<br /><br />
376-
If you did not request a password reset, please ignore this email, and your password will remain the same.]]></source>
377-
<target state="new"><![CDATA[Hi,
378-
<br /><br />
379-
We have received a request to reset the password for your Ibexa DXP account. Click “reset password” below to choose a new password:
380-
<br /><br />
381-
<a href="%reset_password%">Reset password</a>
382-
<br /><br />
383-
If you did not request a password reset, please ignore this email, and your password will remain the same.]]></target>
384-
<note>key: ezplatform.forgot_user_password.message</note>
385-
</trans-unit>
386-
<trans-unit id="801ba7693e80ca58fbf2a9da2b735bf3f324fd27" resname="ezplatform.forgot_user_password.reset_your_password">
387-
<source>Reset your password</source>
388-
<target state="new">Reset your password</target>
389-
<note>key: ezplatform.forgot_user_password.reset_your_password</note>
390-
</trans-unit>
391369
<trans-unit id="264649149b7563144f9e2c462b13477dc7441302" resname="ezplatform.registration_confirmation.header">
392370
<source>Your account has been created</source>
393371
<target state="new">Your account has been created</target>
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
1-
{%- block from -%}
2-
{%- endblock from -%}
1+
{% extends '@ibexadesign/ui/mail/base_mail_template.html.twig' %}
2+
3+
{% trans_default_domain 'ibexa_admin_ui' %}
34

45
{%- block subject -%}
5-
{{ 'ezplatform.forgot_user_password.reset_your_password'|trans|desc('Reset your password') }}
6+
{{ 'forgot_user_password.mail.reset_your_password'|trans|desc('Reset your password') }}
67
{%- endblock subject -%}
78

8-
{%- block body -%}
9-
<p>
10-
{{ 'ezplatform.forgot_user_password.message'|trans({ '%reset_password%': url('ibexa.user.reset_password', {'hashKey': hash_key}) })|raw
11-
|desc('Hi,
12-
<br /><br />
13-
We have received a request to reset the password for your Ibexa DXP account. Click “reset password” below to choose a new password:
14-
<br /><br />
15-
<a href="%reset_password%">Reset password</a>
16-
<br /><br />
17-
If you did not request a password reset, please ignore this email, and your password will remain the same.') }}
18-
</p>
19-
{%- endblock body -%}
9+
{%- block mail_message_title_content -%}
10+
{{ 'forgot_user_password.mail.message_title'|trans()|desc('Hello,') }}
11+
{%- endblock mail_message_title_content -%}
12+
13+
{%- block mail_message_content %}
14+
{{ 'forgot_user_password.mail.message'|trans()|desc('We have received a request to reset the password for your account. Click "reset password" below to choose a new password:') }}
15+
{%- endblock mail_message_content %}
16+
17+
{%- block mail_actions_content -%}
18+
{% include '@ibexadesign/ui/mail/action_btn.html.twig' with {
19+
url: url('ibexa.user.reset_password', {
20+
'hashKey': hash_key
21+
}),
22+
label: 'forgot_user_password.mail.reset_password'|trans()|desc('Reset password')
23+
} %}
24+
{%- endblock mail_actions_content -%}
25+
26+
{%- block mail_footer_content -%}
27+
{{ 'forgot_user_password.mail.message_footer'|trans()|desc('If you did not request a password reset, please ignore this email, and your password will remain the same.') }}
28+
{%- endblock mail_footer_content -%}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{% set link_width = label|length * 10 %}
2+
{% set btn_width = link_width + 32 %}
3+
4+
{% macro button_side_img(src, width_px = 16, height_px = 48) %}
5+
{% if src %}
6+
<td width="{{ width_px }}" height="{{ height_px }}" style="background: #AE1164;">
7+
<img style="display: block; width: 16px; height: 48px" src="{{ src }}" >
8+
</td>
9+
{% endif %}
10+
{% endmacro %}
11+
12+
<table
13+
role="presentation"
14+
cellspacing="0"
15+
cellpadding="0"
16+
border="0"
17+
width="{{ btn_width }}"
18+
>
19+
<tr>
20+
{{ _self.button_side_img(btn_primary_left_side|default(null)) }}
21+
<td width="{{ link_width }}" height="48">
22+
<a
23+
style="
24+
display: table-cell;
25+
width: {{ link_width }}px;
26+
height: 48px;
27+
color: #ffffff;
28+
text-align: center;
29+
text-decoration: none;
30+
vertical-align: middle;
31+
background: #AE1164;
32+
"
33+
href="{{ url }}"
34+
>
35+
{{ label }}
36+
</a>
37+
</td>
38+
{{ _self.button_side_img(btn_primary_right_side|default(null)) }}
39+
</tr>
40+
</table>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{% macro row(content, styles) %}
2+
{% set styles = {
3+
width: width|default('585px'),
4+
'border': '1px solid red'
5+
}|merge(styles|default({})) %}
6+
7+
<tr>
8+
<td style="{%- for property_name, property_value in styles -%}{{property_name}}: {{property_value}}; {%- endfor -%}">{{ content|raw }}</td>
9+
</tr>
10+
{% endmacro %}
11+
12+
{%- block subject -%}{%- endblock subject -%}
13+
{%- block from -%}{%- endblock from -%}
14+
15+
{% block DOCTYPE %}
16+
<!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
17+
{% endblock %}
18+
19+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
20+
{%- block head -%}
21+
<head>
22+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
23+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
24+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
25+
<meta name="color-scheme" content="light">
26+
<meta name="supported-color-schemes" content="light">
27+
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@300&display=swap" rel="stylesheet">
28+
<title>{%- block head_title -%}Ibexa DXP{%- endblock head_title -%}</title>
29+
</head>
30+
{%- endblock head -%}
31+
{%- block body -%}
32+
<body style="background: #fffffe;">
33+
<table
34+
role="presentation"
35+
cellspacing="0"
36+
cellpadding="0"
37+
border="0"
38+
width="585"
39+
style="font-family: 'Noto Sans', sans-serif; border-collapse: collapse; background: #ffff00;"
40+
>
41+
{%- block mail_header -%}
42+
{% set content %}
43+
{%- block mail_header_content -%}
44+
{% if header_img_path is defined %}
45+
{# <img
46+
style="width: 585px; height: 100px;"
47+
src="{{ header_img_path }}"
48+
alt="{%- block mail_header_alt_text -%}Ibexa DXP{%- endblock mail_header_alt_text -%}"
49+
/> #}
50+
{% else %}
51+
{% block mail_header_alternative_img_content %}
52+
<h2>Ibexa DXP</h2>
53+
{% endblock mail_header_alternative_img_content %}
54+
{% endif %}
55+
{%- endblock mail_header_content -%}
56+
{% endset %}
57+
58+
{{ _self.row(content, { height: '100px'}) }}
59+
{%- endblock mail_header -%}
60+
61+
{%- block mail_message_title -%}
62+
{% set content %}
63+
{%- block mail_message_title_content -%}{%- endblock mail_message_title_content -%}
64+
{% endset %}
65+
66+
{{ _self.row(content) }}
67+
{%- endblock mail_message_title -%}
68+
69+
{%- block mail_message -%}
70+
{% set content %}
71+
{%- block mail_message_content -%}{%- endblock mail_message_content -%}
72+
{% endset %}
73+
74+
{{ _self.row(content, { 'padding-bottom': '32px', 'line-height': '28px' }) }}
75+
{%- endblock mail_message -%}
76+
77+
{%- block mail_actions -%}
78+
{% set content %}
79+
{%- block mail_actions_content -%}{%- endblock mail_actions_content -%}
80+
{% endset %}
81+
82+
{{ _self.row(content, { 'padding-bottom': '48px' }) }}
83+
{%- endblock mail_actions -%}
84+
85+
{%- block mail_footer -%}
86+
{% set line %}
87+
<div style="width: 100%; height: 1px; background: #e0e0e0;"></div>
88+
{% endset %}
89+
{% set content %}
90+
{%- block mail_footer_content -%}{%- endblock mail_footer_content -%}
91+
{% endset %}
92+
93+
{{ _self.row(line) }}
94+
{{ _self.row(content, { 'line-height': '20px' }) }}
95+
{%- endblock mail_footer -%}
96+
</table>
97+
</body>
98+
{%- endblock body -%}
99+
</html>

0 commit comments

Comments
 (0)