Skip to content

Commit

Permalink
set back message as html
Browse files Browse the repository at this point in the history
  • Loading branch information
ludwigdn committed Nov 26, 2022
1 parent 937aad0 commit e8056c7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
21 changes: 11 additions & 10 deletions SecretSanta/Utils/MailMessageFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,23 @@ public string GetHtmlBody(Participant santa)
bodyMessage = string.Format(body, santa.Name, santa.ReceiversName);
}

StringBuilder stringBuilder = new StringBuilder();
stringBuilder.AppendLine($"");
stringBuilder.AppendLine($"--------------------------------------------------");
stringBuilder.AppendLine($"{_localeService.Get(LocaleService.AUTO_BODY_TITLE)}");
stringBuilder.AppendLine($"--------------------------------------------------");
stringBuilder.AppendLine($"");
stringBuilder.AppendLine($"{bodyMessage}");
stringBuilder.AppendLine($"");
return stringBuilder.ToString();
return string.Join(Environment.NewLine, new string[]{
$"<h1>{_localeService.Get(LocaleService.AUTO_BODY_TITLE)}</h1>",
bodyMessage,
});
}

private string GetGiftIdeasFormatted(List<string> giftIdeas)
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("<br/>");
stringBuilder.Append("<br/>");
stringBuilder.Append("<ul>");
foreach (var gift in giftIdeas.Where(o => !string.IsNullOrWhiteSpace(o)))
stringBuilder.AppendLine($" - {gift}");
stringBuilder.Append($"<li>{gift}</li>");
stringBuilder.Append("</ul>");
stringBuilder.Append("<br/>");
stringBuilder.Append("<br/>");
return stringBuilder.ToString();
}
}
Expand Down
4 changes: 2 additions & 2 deletions SecretSanta/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
},

"Auto" : {
"Body": "{0}, you were chosen to give a present to -- {1} --. Try to fit to what they like! If you have no clue, just ask around :-)\r\n\r\nHappy Holidays to all, and keep the secret until the last minute !",
"BodyWithGifts": "{0}, you were chosen to give a present to -- {1} --. Here's a list of stuff that could please them:\r\n\r\n{2}\r\n\r\nHappy Holidays to all, and keep the secret until the last minute !",
"Body": "<strong>{0}</strong>, you were chosen to give a present to <strong>{1}</strong>. Try to fit to what they like! If you have no clue, just ask around :-) Happy Holidays to all, and keep the secret until the last minute !",
"BodyWithGifts": "<strong>{0}</strong>, you were chosen to give a present to <strong>{1}</strong>. Here's a list of stuff that could please them: {2} Happy Holidays to all, and keep the secret until the last minute !",
"BodyTitle" : "Secret Santas have been chosen!",
"Thanks" : "Thanks for using this app. Season's greetings !",
"Thanks2" : "Press enter to stop..."
Expand Down
4 changes: 2 additions & 2 deletions SecretSanta/locale/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
},

"Auto" : {
"Body": "{0}, vous allez offrir un cadeau à -- {1} --. Essayez de lui faire un cadeau personnalisé !Renseignez-vous auprès des autres pour savoir ce qui lui ferait plaisir :-)\r\n\r\nJoyeuses fêtes à tous, et gardez la surprise jusqu'au bout !",
"BodyWithGifts": "{0}, vous allez offrir un cadeau à -- {1} --. Voici quelques idées qui lui feraient plaisir :\r\n\r\n{2}\r\n\r\nJoyeuses fêtes à tous, et gardez la surprise jusqu'au bout !",
"Body": "<strong>{0}</strong>, vous allez offrir un cadeau à <strong>{1}</strong>. Essayez de lui faire un cadeau personnalisé !Renseignez-vous auprès des autres pour savoir ce qui lui ferait plaisir :-) Joyeuses fêtes à tous, et gardez la surprise jusqu'au bout !",
"BodyWithGifts": "<strong>{0}</strong>, vous allez offrir un cadeau à <strong>{1}</strong>. Voici quelques idées qui lui feraient plaisir : {2} Joyeuses fêtes à tous, et gardez la surprise jusqu'au bout !",
"BodyTitle" : "Le tirage au sort du Secret Santa a été effectué !",
"Thanks" : "Merci d'avoir utilisé cette application. Passez de bonnes fêtes de fin d'années !",
"Thanks2" : "Appuyez sur entrée pour arrêter..."
Expand Down

0 comments on commit e8056c7

Please sign in to comment.