Contact-mail: vervolg op review (notitie weg, tekstdeel ingesprongen, nieuwe Core-tests voor details en Reply-To)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -108,11 +108,11 @@ public sealed class MailTemplateRenderer : IMailTemplateRenderer
|
||||
{
|
||||
["nl"] = new("Nieuw bericht via {0}", "Nieuw bericht via het contactformulier",
|
||||
"Er is een bericht verstuurd via het contactformulier van {0}.",
|
||||
null, "Je kunt direct op deze mail antwoorden: het antwoord gaat naar het e-mailadres van de afzender.",
|
||||
null, null,
|
||||
"Deze mail is automatisch verstuurd door {0}."),
|
||||
["en"] = new("New message via {0}", "New message from the contact form",
|
||||
"A message was sent through the contact form of {0}.",
|
||||
null, "You can reply to this message directly: the reply goes to the sender's e-mail address.",
|
||||
null, null,
|
||||
"This message was sent automatically by {0}.")
|
||||
}
|
||||
};
|
||||
@@ -287,8 +287,15 @@ public sealed class MailTemplateRenderer : IMailTemplateRenderer
|
||||
{
|
||||
foreach (var detail in details)
|
||||
{
|
||||
// Plain text: a label line, then the value as written (the message keeps its own line breaks).
|
||||
sb.Append(detail.Label).AppendLine(":").AppendLine(detail.Value.Replace("\r\n", "\n").Replace('\r', '\n')).AppendLine();
|
||||
// Plain text: a label line, then the value indented two spaces per line, so a visitor's own
|
||||
// '--' line or fake headings cannot imitate the layout of the mail.
|
||||
sb.Append(detail.Label).AppendLine(":");
|
||||
foreach (var line in detail.Value.Replace("\r\n", "\n").Replace('\r', '\n').Split('\n'))
|
||||
{
|
||||
sb.Append(" ").AppendLine(line);
|
||||
}
|
||||
|
||||
sb.AppendLine();
|
||||
}
|
||||
}
|
||||
if (url is not null) sb.AppendLine(url).AppendLine();
|
||||
|
||||
Reference in New Issue
Block a user