cancel
Showing results for 
Search instead for 
Did you mean: 

Email Properties Problem

thestorm
Champ in-the-making
Champ in-the-making
Dear people, i have a simple workflow (accept or reject), that approves a document and then sends to the CEO that also approves it, if the CEO rejects it i want the creator of the document to get an email, how can i do this with simple workflow (maybe a script?!??)

best regards
Sebastian


//!!! Update in 6. Post !!!\\
5 REPLIES 5

beren
Champ in-the-making
Champ in-the-making
Hi Sebastian,

You want the creator notified as opposed to the initiator of the workflow event? The workflow included in the advanced workflow includes a notification back to the initiator.

beren

thestorm
Champ in-the-making
Champ in-the-making
but i cant use advanced workflow as a business rule 😕 thats my problem

im tryin to create a script

i get the creator by this line

<b>Creator:</b> ${document.properties.creator}<br>

but how to get his email adress?!

person.properties.email gives me the adress of the current user

please some1 help

adelatorre
Champ in-the-making
Champ in-the-making
but i cant use advanced workflow as a business rule 😕 thats my problem

Hi,
you can create a script that creates an advanced worklfow http://wiki.alfresco.com/wiki/3.0_JavaScript_API#Workflow_API and that one you can launch as a business rule.

Hope helps,

Antonio

adelatorre
Champ in-the-making
Champ in-the-making
<b>Creator:</b> ${document.properties.creator}<br>

but how to get his email adress?!

person.properties.email gives me the adress of the current user

please some1 help

Hi again,

in alfresco javascript:

var usercreator = document.properties.creator
var useremail = usercreator.properties.email

Try it! 🙂

Antonio

thestorm
Champ in-the-making
Champ in-the-making
I got this error:

A system error happened during the operation: Failed to execute script 'workspace://SpacesStore/e540845b-cbc4-418e-8ec5-957c4bb894a4': TypeError: Cannot read property "email" from undefined (AlfrescoScript#2)

the script i used was:


var usercreator = document.properties.creator
var useremail = usercreator.properties.email
// create mail action
var mail = actions.create("mail");
mail.parameters.to = useremail;
mail.parameters.subject = "Dokument wurde abgelehnt";
mail.parameters.from = "alfresco@alfresco.com";
mail.parameters.text = "Test blaaaaaaaaaaaaaaaaaa";
// execute action against a document   
mail.execute(doc);

if i use var useremail = seda.properties.email

i get this error:

Please correct the errors below then click OK.

    * A system error happened during the operation: Failed to execute script 'workspace://SpacesStore/e540845b-cbc4-418e-8ec5-957c4bb894a4': ReferenceError: "seda" is not defined. (AlfrescoScript#2)