Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Barry Fogarty 493 posts 1129 karma points
    Nov 26, 2013 @ 17:04
    Barry Fogarty
    0

    Comment tokens in Email tasks not working

    I have Workflow happening in Umbraco 6.1.6 (workflow 2.2.) and emails are being sent at the transitions.  However, if I insert tokens into the email templates, no email is sent.  e.g.

    Hello {Instantiator}

    Your changes were not accepted.

    Comments: {Comment}

     

    Are email tokens working in 2.2?

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Nov 26, 2013 @ 18:02
    Darren Ferguson
    0

    Hi Barry,

    Does the task progress even though no email is sent. If I'm honest I haven't tested the email tasks in the latest release.

  • Barry Fogarty 493 posts 1129 karma points
    Nov 26, 2013 @ 19:03
    Barry Fogarty
    0

    Hey Darren -

    OK I have done some more detailed testing now.  I have tokens working in the email - but only where the workflow is manually instantiated.   Also there is a problem here - I want to show the transition comment after the decision task, but it will only output the Instatiation comment - using {Comment}.

    I have a simple workflow set up on the AfterSendToPublish event where users in the writers group will trigger a workflow for users in the editors group.  In this case, the editor gets the notification to approve, but when they transition, no email is sent back to the writer (only if the email template contains tokens - if these are removed, emails are sent fine).

    In both cases above the workflow completes.  I checked the log file and can see

    ERROR 79 umbraco.library - [Thread 79] umbraco.library.SendMail: Error sending mail.
    System.ArgumentException: The parameter 'to' cannot be an empty string.
    Parameter name: to
    at System.Net.Mail.MailMessage..ctor(String from, String to)

    My test writer and editor both have valid emails.

    So, 2 issues:

    1. Seems as though Event-driven tasks have a problem attaching the originator's email
    2. How to differentiate between the instantiation comment and the trasition comment.
  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Nov 27, 2013 @ 09:58
    Darren Ferguson
    0

    Hi Barry, I could have a look tomorrow but am travelling today.

    The easiest way to figure this out would be to grab the source of the email task, copy it and make a custom task (see http://vimeo.com/30190458)

    Then you could copy your DLL in and attach to process to see what is going on.

    I don't remember whether the transition comment is exposed to the email task or not at present, thought it should be trivial to implement.

    Of course workflow is on github now so you can fix any of this :) It is a bit of a monster to build, but give me a shout if you need a hand!

     

     

     

     

     

     

  • Barry Fogarty 493 posts 1129 karma points
    Nov 28, 2013 @ 13:35
    Barry Fogarty
    0

    Hey Darren,

    Cheers - we have shelved this on my project for now but let me know if you update the code so I can use transition comments in the emails.  If I get the client to OK the time I will have a bash at fixing the source  - nice one

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Nov 28, 2013 @ 13:47
    Darren Ferguson
    0

    Will do - you can just watch the project on github and subscribe to commits if you'd like.

Please Sign in or register to post replies

Write your reply to:

Draft