We have a question for Alfresco 5.2 Using javascript (API) we want to send some emails for a CronJobs that we are developing. We have seen that if we use "mail.parameters.to_many" we cannot send "CC".
We need to send MyLowesLife
To: "email1@xxx.com", "email2@xxx.com"
cc: "email3@xxx.com"
If we use:
mail.parameters.to = "email1@xxx.com"
mail.parameters.cc = "email3@xxx.com"
we correctly receive the "to" and the "CC"
But if we use:
mail.parameters.to_many = ["email1@xxx.com", "email2@xxx.com"]
mail.parameters.cc = "email3@xxx.com"
We received in the "to" "email1@xxx.com", "email2@xxx.com" but "CC" empty.
How can you send multiple emails "to" with "CC"? Example with "to" and "CC":
var subj= "prueva de multiples";
var mail = actions.create("mail");
mail.parameters.to ="email1@xxx.com";
mail.parameters.cc = "email3@xxx.com";
mail.parameters.subject = subj;
mail.parameters.from = "serverMail.com";
mail.parameters.text = "This test is OK";
mail.executeAsynchronously(node);
(Works correctlym It works fine, but a "to" and a "CC")
Example 2:
var subj= "prueva de multiples";
var mail = actions.create("mail");
var emails = ["email1@xxx.com","email2@xxx.com","email3@xxx.com"];
mail.parameters.to_many = emails;
mail.parameters.cc = ""email4CC@xxx.com";
mail.parameters.subject = subj;
mail.parameters.from = "serverMail.com";
mail.parameters.text = "This test is not Ok";
mail.executeAsynchronously(node);
(Sends the "to_many", but the "CC" does not send it)
We want to send multiple emails in "to" and multiple in "CC".
The most important thing for us is to be able to send one "to" and multiple "CC"
Thanks guys
Unfortunately Alfresco's default mail action really does not support that case. Only when "to" is not set, "to_many" will be used - and in that case "cc" and "bcc" are completely ignored. There is no point in argueing whether this is sensible or not (it is not in my opinion) as this functionality has always been this broken, and won't ever change. In fact, this is one of the reasons I recently created my own variant of the mail action in a customer project in which I needed to handle various notifications. My variant allows for "to" to be either a single address or multiple, the same for "cc" and "bcc".
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.