Several days ago I was faced with a problem that Alfresco doesn't allow to send email with attachments and I written small patch to add this feature. I believe this AMP will be useful for somebody.
Addon was tested on Alfresco 5.0.a
Addon was tested on Alfresco 5.0.a
What do you need to do:
- Download amp
- Put this file into {Alfresco}/amps folder
- Stop Alfresco
- Run script {Alfresco}/bin/apply_amps.sh
- Run Alfresco
- After that you will get ability to send email with attachments
How to send email with attachments (example):
// create email var mail = actions.create("mail"); // set receiver of the email mail.parameters.to = "to.somebody@gmail.com"; // set mail subject mail.parameters.subject = "Email with attachments"; // set sender of the email mail.parameters.from = "from.somebody@gmail.com"; // set mail body mail.parameters.text = "This is my first email with attachments"; // initialize array of attachments var array = []; //add document to array array.push(document.nodeRef); //add one more document to array array.push(document1.nodeRef); // add attachments to the email mail.parameters.attachments = array; // send email mail.execute(document);
Hi Sergey,
ОтветитьУдалитьI am using alfresco 5.2 and trying to achieve the same functionality through js. I want multiple attachments to be sent to a recipient. I have used your js given in this blog, able to send mail but without attachments. Kindly help me to send mail with attachments.
Hi Owais,
ОтветитьУдалитьI am not sure that it will work on Alfresco 5.2. The AMP was developed for Alfresco 5.0.a, so maybe it requires some changes in the code...