From: Andy Brandt Date: Thu, 8 Jun 2023 17:42:32 +0000 (-0500) Subject: Fix private message e-mail notification subject and body (#2963) X-Git-Url: http://these/git/ui/assets/%7Bthis.getImage%28%29%7D?a=commitdiff_plain;h=f98476c5c0f2941942a9f41266d45f04c86315a9;p=lemmy.git 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. --- diff --git a/crates/api_crud/src/private_message/create.rs b/crates/api_crud/src/private_message/create.rs index 3b3dd70c..3f1d4ef8 100644 --- a/crates/api_crud/src/private_message/create.rs +++ b/crates/api_crud/src/private_message/create.rs @@ -89,14 +89,11 @@ impl PerformCrud for CreatePrivateMessage { let local_recipient = LocalUserView::read_person(context.pool(), recipient_id).await?; let lang = get_interface_language(&local_recipient); let inbox_link = format!("{}/inbox", context.settings().get_protocol_and_hostname()); + let sender_name = &local_user_view.person.name; send_email_to_user( &local_recipient, - &lang.notification_private_message_subject(&local_recipient.person.name), - &lang.notification_private_message_body( - inbox_link, - &content_slurs_removed, - &local_recipient.person.name, - ), + &lang.notification_private_message_subject(sender_name), + &lang.notification_private_message_body(inbox_link, &content_slurs_removed, sender_name), context.settings(), ); }