When I have code:
var mail = actions.create("mail");
mail.parameters.to = "...";
mail.parameters.subject = "...";
mail.parameters.from = "...";
mail.parameters.text = "some text, in case template is not found";
//// execute action against a document
var doc = search.findNode("workspace://SpacesStore/eafb46a7-a139-42e1-b297-71402d279b68");
mail.execute(doc);
I am curious, what is the meaning of providing node for execution of sending an email? Does this affect something somewhere or it doesn’t make change?
Thanks!
Actions typically need a context to run against. That context is usually a node (like a folder or a document). In this case, it allows the action and the freemarker mail template to pull properties from the document. Like maybe you want your email to have the name of the document or some other metadata.
Whether or not the “actioned upon node” is affected by having the action run against it is dependent on the code in the action. In the case of the mail action it should not be modifying the node.