OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.38k stars 1.12k forks source link

Possible exception on sending email if users are moderated #4753

Open orchardbot opened 10 years ago

orchardbot commented 10 years ago

tearaway_Tea created: https://orchard.codeplex.com/workitem/20924

Hey guys,

I noticed in the MembershipService class, CreateUser() method in the section of sending events to users that if they are moderated the Recipients value is passed as Array: var parameters = new Dictionary<string, object> { {"Subject", T("New account").Text}, {"Body", _shapeDisplay.Display(template)}, {"Recipients", new [] { recipient.Email }} // <-- HERE };

                _messageService.Send("Email", parameters);

Where the SmtpMessageChannel class expects recipients to be comma separated string: var emailMessage = new EmailMessage { Body = parameters["Body"] as string, Subject = parameters["Subject"] as string, Recipients = parameters["Recipients"] as string // <-- HERE };

I checked the rest of the places where _messageService.Send() is used and there are no Array usage there, so I assume this may be a bug. Please confirm if so, I can make a pool request too if it's more convenient.

Thanks!

orchardbot commented 10 years ago

planetClaire commented:

Please do tearaway_Tea, I just ran into this & that moderator's email shouldn't be wrapped in an array