cancel
Showing results for 
Search instead for 
Did you mean: 

workflows don't send e-mails

kay_be_
Champ in-the-making
Champ in-the-making
None of my workflow send out e-mails.

I configured outbound e-mail with gmail SMTPS:
mail.host=smtp.gmail.com
mail.port=465
[email protected]
mail.password=xxxxxxx
mail.encoding=UTF-8
[email protected]
mail.smtps.auth=true
mail.protocol=smtps
mail.smtps.Starttls.enable=true
Inviting users to spaces result in an e-mail message as it is supposed to do.
It doesn't work with workflow e-mails like the
system: alfresco 3.4d
Alfresco doesn't seem to log any errors when completing a workflow.

What is the difference in the system mails sended out and succeed and the workflow e-mails sended?
How can this be resolved?

Thanks.
Kris
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
The Alfresco workflows do not notify by email, although of course you could add notification tasks where appropriate.

kay_be_
Champ in-the-making
Champ in-the-making
Ok, I thought the default workflows send e-mail to.

What I did is creating a new workflow. I used the book from Wrox: Professional Alfresco.

When I place my script in an other place in the workflow the mail is sent.
So there must be something wrong with the code I got from the book?

Here is the procesdefinition:

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="mywf:myReviewAndApprove">

   <swimlane name="initiator"></swimlane>

   <swimlane name="reviewer">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <actor>#{bpm_assignee}</actor>
      </assignment>
   </swimlane>

   <start-state name="start">
      <task name="mywf:mySubmitReviewTask" swimlane="initiator"></task>
      <transition name="" to="review"></transition>
   </start-state>

   <task-node name="review">
      <task name="mywf:myReviewTask" swimlane="reviewer"></task>
      <transition name="approve" to="approve"></transition>
      <transition name="reject" to="reject"></transition>
   </task-node>

   <node name="approve">
      <event type="node-enter">
         <script>
            <variable name="reviewResult" access="write"></variable>
            <expression>
               reviewResult = "approved";
            </expression>
         </script>
      </event>
      <transition to="completed"></transition>
   </node>

   <node name="reject">
      <event type="node-enter">
         <script>
            <variable name="reviewResult" access="write"></variable>
            <expression>
               reviewResult = "rejected";
            </expression>
         </script>
      </event>
      <transition to="completed"></transition>
   </node>

   <task-node name="completed">
      <event type="node-enter">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
               var mail = actions.create("mail");
               mail.parameters.to = initiator.properties["cm:email"];
               mail.parameters.subject = "Review Task " + bpm_workflowDescription;
               mail.parameters.from = bpm_assignee.properties["cm:email"];
               mail.parameters.text= "The article has been " + reviewResult + ".";
               mail.execute(bpm_package);
            </script>
         </action>
      </event>
      <task name="mywf:myCompleteReviewTask" swimlane="initiator"></task>
      <transition name="" to="end"></transition>
   </task-node>

   <end-state name="end"></end-state>

</process-definition>

Here is the workflow-model:

<model name="mywf:myReviewAndApproveModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <description>Example Review And Approve Task Model</description>
   <author>Alfresco</author>
   <version>1.0</version>

   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"></import>
      <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"></import>
   </imports>
   <namespaces>
      <namespace uri="http://www.redtree.org/model/workflow/1.0" prefix="mywf"></namespace>
   </namespaces>

   <types>

      <type name="mywf:mySubmitReviewTask">
         <parent>bpm:startTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

      <type name="mywf:myReviewTask">
         <parent>bpm:workflowTask</parent>
         <overrides>
            <property name="bpm:packageItemActionGroup">
               <default>edit_package_item_actions</default>
            </property>
         </overrides>
      </type>

      <type name="mywf:myCompleteReviewTask">
         <parent>bpm:workflowTask</parent>
         <mandatory-aspects>
            <aspect>bpm:assignee</aspect>
         </mandatory-aspects>
      </type>

   </types>

</model>

I don't get any error messages, the mail just isn't sent out.

kay_be_
Champ in-the-making
Champ in-the-making
It finally works. Found a typo error in the emailadres of my admin account that I used to start the workflow…  Smiley Surprisedops:
Hours of searching… Finally I got a bunch of emails claiming a DNS error. This way the email was sent to a wrong domain… Time to go home and get some sleep I guess. Obviously I wasn't awake. :mrgreen: