Fix private message e-mail notification subject and body (#2963)

It used to say:

Subject: Private message from [your username]
Body: [your username] - [private message]

It now display the correct username that it's from.
This commit is contained in:
Andy Brandt 2023-06-08 12:42:32 -05:00 committed by GitHub
parent 15c84e2f7b
commit f98476c5c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -89,14 +89,11 @@ impl PerformCrud for CreatePrivateMessage {
let local_recipient = LocalUserView::read_person(context.pool(), recipient_id).await?; let local_recipient = LocalUserView::read_person(context.pool(), recipient_id).await?;
let lang = get_interface_language(&local_recipient); let lang = get_interface_language(&local_recipient);
let inbox_link = format!("{}/inbox", context.settings().get_protocol_and_hostname()); let inbox_link = format!("{}/inbox", context.settings().get_protocol_and_hostname());
let sender_name = &local_user_view.person.name;
send_email_to_user( send_email_to_user(
&local_recipient, &local_recipient,
&lang.notification_private_message_subject(&local_recipient.person.name), &lang.notification_private_message_subject(sender_name),
&lang.notification_private_message_body( &lang.notification_private_message_body(inbox_link, &content_slurs_removed, sender_name),
inbox_link,
&content_slurs_removed,
&local_recipient.person.name,
),
context.settings(), context.settings(),
); );
} }