-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added 'Name' property that replaces first and last name
- Loading branch information
1 parent
890f9f8
commit 66ad61c
Showing
7 changed files
with
41 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.IdentityModel.Tokens; | ||
using MimeKit; | ||
|
||
namespace Application.Utility; | ||
|
@@ -40,11 +41,13 @@ public async Task SendEmailConfirmationEmail(User user, string token) | |
message.From.Add (new MailboxAddress ("Librum", messFrom)); | ||
} | ||
|
||
message.To.Add (new MailboxAddress (user.FirstName, user.Email)); | ||
// Legacy - to be removed | ||
var userName = user.Name.IsNullOrEmpty() ? user.FirstName : user.Name; | ||
message.To.Add (new MailboxAddress (userName, user.Email)); | ||
message.Subject = "Confirm Your Email"; | ||
|
||
message.Body = new TextPart ("plain") { | ||
Text = $"Hello { user.FirstName }.\n\nThank you for choosing Librum! " + | ||
Text = $"Hello { userName }.\n\nThank you for choosing Librum! " + | ||
"We are happy to tell you, that your account has successfully been created. " + | ||
"The final step remaining is to confirm it, and you're all set to go.\n" + | ||
$"To confirm your email, please click the link below:\n{confirmationLink}\n\n" + | ||
|
@@ -78,11 +81,13 @@ public async Task SendPasswordResetEmail(User user, string token) | |
message.From.Add (new MailboxAddress ("Librum",messFrom)); | ||
} | ||
|
||
message.To.Add (new MailboxAddress (user.FirstName, user.Email)); | ||
// Legacy - to be removed | ||
var userName = user.Name.IsNullOrEmpty() ? user.FirstName : user.Name; | ||
message.To.Add (new MailboxAddress (userName, user.Email)); | ||
message.Subject = "Reset Your Password"; | ||
|
||
message.Body = new TextPart ("plain") { | ||
Text = $"Hello { user.FirstName }.\n\nYou can find the link to reset your password below. " + | ||
Text = $"Hello { userName }.\n\nYou can find the link to reset your password below. " + | ||
"Follow the link and continue the password reset on our website.\n" + | ||
$"{resetLink}\n\n" + | ||
"If you didn't request this email, just ignore it." | ||
|
@@ -96,11 +101,13 @@ public async Task SendDowngradeWarningEmail(User user) | |
var message = new MimeMessage(); | ||
message.From.Add (new MailboxAddress ("Librum", "[email protected]")); | ||
|
||
message.To.Add (new MailboxAddress (user.FirstName, user.Email)); | ||
// Legacy - to be removed | ||
var userName = user.Name.IsNullOrEmpty() ? user.FirstName : user.Name; | ||
message.To.Add (new MailboxAddress (userName, user.Email)); | ||
message.Subject = "Your books may be deleted in 7 days! - Take Action"; | ||
|
||
message.Body = new TextPart ("plain") { | ||
Text = $"Hello { user.FirstName },\n\nYou have recently downgraded your Account. " + | ||
Text = $"Hello { userName },\n\nYou have recently downgraded your Account. " + | ||
"Due to the downgrade your online storage was reduced and your current library " + | ||
"size may exceed your new storage limit.\n" + | ||
$"Please reduce your library size if that is the case, otherwise books from your account will automatically be DELETED until " + | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters