mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#20606: Fixed implementation of e-mail reply-to functionality.
There was a breaking change introduced in the initial commit. ReplyTo field is optional but was not treated as such. Also, made it possible to specify more than one reply-to address, similar to recipients.
This commit is contained in:
@@ -48,7 +48,7 @@ namespace Orchard.Email.Services {
|
||||
Body = parameters["Body"] as string,
|
||||
Subject = parameters["Subject"] as string,
|
||||
Recipients = parameters["Recipients"] as string,
|
||||
ReplyTo = parameters["ReplyTo"] as string
|
||||
ReplyTo = parameters.ContainsKey("ReplyTo") ? parameters["ReplyTo"] as string : null
|
||||
};
|
||||
|
||||
if (emailMessage.Recipients.Length == 0) {
|
||||
@@ -78,7 +78,9 @@ namespace Orchard.Email.Services {
|
||||
}
|
||||
|
||||
if (!String.IsNullOrWhiteSpace(emailMessage.ReplyTo)) {
|
||||
mailMessage.ReplyToList.Add(new MailAddress(emailMessage.ReplyTo));
|
||||
foreach (var recipient in emailMessage.ReplyTo.Split(new [] {',', ';'}, StringSplitOptions.RemoveEmptyEntries)) {
|
||||
mailMessage.ReplyToList.Add(new MailAddress(recipient));
|
||||
}
|
||||
}
|
||||
|
||||
_smtpClientField.Value.Send(mailMessage);
|
||||
|
Reference in New Issue
Block a user