Wulf/create-rust-app

Mail service not using designated templates

tonyadastra opened this issue · 1 comments

looks like we're not using the templates specified in files under auth/mail.

all the rust files there contain #[allow(dead_code)]

How can we specify our own email templates?

Main reason is that I noticed a trailing ) on the email subject lines and would like to customize the link

Thanks

specifically:

This is not a huge issue, but worth looking into. It appears like the emails are not using
/the templates located in backend/mail

for instance, in auth_recover_existent_account.rs, we have

pub fn send(mailer: &Mailer, to_email: &str, link: &str) {
    let subject = "Password Reset Instructions";
    let text = format!(
        r#"
(This is an automated message.)

Hello,

Someone requested a password reset for the account associated with this email.
Please visit this link to reset your password:
{link}
(valid for 24 hours)
"#
    );
    let html = format!(
        r#"
(This is an automated message.)

Hello,

Someone requested a password reset for the account associated with this email.
Please visit this link to reset your password:
{link}
(valid for 24 hours)
"#
    );

    mailer.send(to_email, subject, &text, &html);
}

but my email looks like
Reset Password Instructions)

(This is an automated message.) Hello, Someone requested a password reset for the account associated with this email. Please visit this link to reset your password: http://localhost:3000/reset?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2ODEwNjM5MDYsInN1YiI6MSwidG9rZW5fdHlwZSI6InJlc2V0X3Rva2VuIn0.UGRqHOCrz75hkcqQT02b2NrSeTTb8iNKGOy93Yty2QM (valid for 24 hours)