I am trying to get an application to send notifications to all administrators when certain actions are performed. Everything works fine if I have only one administrator, but I always get an error when there are several administrators. I use a granulator to give roles to user administrators, and Mandrill to send emails. In my Mandrill dash, I get successful API calls when this is done, but when I test it using the console, I get an error.
In my mail file:
def new_ticket_created ticket
to = User.with_role(:administrator).map{|user| user.email}.uniq.join ','
mail to: to, subject: "New ticket created!"
end
The error I get in the console is:
ProjectMailer
[{"email"=>"admin_user@validemail.com, admin_user2@validemail.com", "status"=>"invalid", "reject_reason"=>nil}]
, 1 , admin, . , , , , .