Skip to content

Commit

Permalink
Fix email footer (#748)
Browse files Browse the repository at this point in the history
* fix footer

---------

Co-authored-by: Aleksander <[email protected]>
Co-authored-by: Robert Olejnik <[email protected]>
  • Loading branch information
3 people authored Aug 27, 2024
1 parent 58efdff commit f19afb0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ pub fn email_mfa_activation_mail(
) -> Result<String, TemplateError> {
let (mut tera, mut context) = get_base_tera(None, Some(session), None, None)?;
let timeout = server_config().mfa_code_timeout;
context.insert("code", code);
// zero-pad code to make sure it's always 6 digits long
context.insert("code", &format!("{code:0>6}"));
context.insert("timeout", &timeout.to_string());
context.insert("name", &user.first_name);
tera.add_raw_template("mail_email_mfa_activation", MAIL_EMAIL_MFA_ACTIVATION)?;
Expand All @@ -276,7 +277,8 @@ pub fn email_mfa_code_mail(
) -> Result<String, TemplateError> {
let (mut tera, mut context) = get_base_tera(None, session, None, None)?;
let timeout = server_config().mfa_code_timeout;
context.insert("code", code);
// zero-pad code to make sure it's always 6 digits long
context.insert("code", &format!("{code:0>6}"));
context.insert("timeout", &timeout.to_string());
context.insert("name", &user.first_name);
tera.add_raw_template("mail_email_mfa_code", MAIL_EMAIL_MFA_CODE)?;
Expand Down
2 changes: 1 addition & 1 deletion templates/base.tera
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
</p>
{% endif %}
{% if ip_address %}
< style="margin: auto;">
<p style="margin: auto;">
<span>IP Address:</span> {{ ip_address | safe }}
</p>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion templates/mail_mfa_configured.tera
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ mfa_method -> what method was activated
{% import "macros.tera" as macros %}
{% block mail_content %}
{% set section_content = [macros::paragraph(content="A Multi-Factor Authorization method: " ~ mfa_method ~ " has been
activated in your account.")] %}
activated in your account.", align="center")] %}
{{ macros::text_section(content_array=section_content) }}
{% endblock %}

0 comments on commit f19afb0

Please sign in to comment.