AnsweredAssumed Answered

send email with xml attatchment

Question asked by sharifu on Sep 10, 2013
Latest reply on Sep 11, 2013 by sharifu
I am using alfresco 4.2.c. I want to create a rule which triggers a script that will send an email with xml file that contains all properties of that document that was updated. so far I have come across posts which are old and related to version 3.x of alfesco. I need some clarification for version 4.x

<javascript>
function sendMail()
{
    var mail = actions.create("mail");
    mail.parameters.to = "sharif.uddin@domain.com"; //bpm_groupAssignees.properties["cm:email"];
    mail.parameters.subject = "New File uplodaded with name " + document.name;
    mail.parameters.from = "alfresco@domain.com";//initiator.properties["cm:email"];
    mail.parameters.text = "Kindly approve the document: " + document.name;
   mail.parameters.node=document;
    mail.execute(document);
}

function createXML(){   
   var v = new  XMLWriter();
   v.writeStartDocument(true);
   v.writeElementString('test','Hello World');
   v.writeAttributeString('foo','bar');
   v.writeEndDocument();
   //console.log( v.flush() );
}

//createXML();
sendMail();
</javascript>

mail.parameters.node=document; does not work.

Outcomes