+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Custom Workflow Notification Email

Custom Workflow Notification Email

14 posts, 0 answered
  1. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    23 Jan 2012
    Link to this post
    I want to be able to send custom emails when a page is updated for approval. I saw the following line in PagesApprovalWorkflow.xamlx:

    <tswa:NotifyGroup EmailText="You have new items waiting approval." Group="Approve" sap:VirtualizedContainerService.HintSize="292,173" />

    Here's the thing: I want the emails to be able to dynamically change based on the page being changed. Is this currently possible (another attribute in the tag, perhaps)?

    Thanks,
    Chris Aumiller

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    24 Jan 2012
    Link to this post
    Hello,

    You should modify the workflow templates. Inside the template you should customize NotifyStateChanger EmailText. Then you have to map customized templates through Sitefinity/Administration/Settings/Advanced >> Workflows. We use Windows Workflow Foundation and you will be able to modify the template in Visual Studio or another text editor. If you inherit from NotifyGroup you can get the item id and decide what message to put in your email template

    public class NotificationActivityBaseCustom : NotifyGroup
        {

            public override List<string> GetEmails(System.Activities.CodeActivityContext context)
            {
                var emails = new List<string>();
                var dataContext = context.DataContext;
                var workflowDefinition = (WorkflowDefinition)dataContext.GetProperties()["workflowDefinition"].GetValue(dataContext);

               var d=  (((Telerik.Sitefinity.Fluent.AnyContent.Implementation.AnyDraftFacade)((dataContext.GetProperties()["masterFluent"].GetValue(dataContext)))));
               var originalID = d.Get().Id;
               return emails;
            }
        }


    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    24 Jan 2012
    Link to this post
    Ivan,

    Where would those templates be located? Somewhere in the SitefinityWebApp project I am assuming? (Only started using Sitefinity last week, so I'm still finding my way around.)

    We do have a custom workflow we are doing this for if that makes any difference.

    Thanks,
    Chris
  4. Mark
    Mark avatar
    147 posts
    Registered:
    01 Jun 2010
    24 Jan 2012
    Link to this post
    In addition to Chris's request for the workflow templates has there been a release of all the templates?

    I'm constantly having to search for an individual template or ask & wait for it to be released on the forum. Why not add a download for all of the templates? If I recall correctly, this was done with Sitefinity 3.
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    26 Jan 2012
    Link to this post
    Hello,

    The templates should be available in the SDK installation package.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    26 Jan 2012
    Link to this post
    Ivan,

    There's no place inside a SitefinityWebApp Visual Studio project where I can get to them? If not, it makes it rather tricky for me...

    Thanks,
    Chris
  7. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    30 Jan 2012
    Link to this post
    Hi,

     I have attached the workflows used by Sitefinity. Here is also a blog post that describes the workflow customization process.

    Kind regards,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    07 Feb 2012
    Link to this post
    When loading the workflows in VS, there seem to be elements missing, and I am unable to look at everything I need.

    This workflow is PagesApprovalWorkflow.xamlx that was located in my SitefinityWebApp directory. Please see attached screenshot. Any ideas?

    Thanks,
    Chris
  9. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    08 Feb 2012
    Link to this post
    Hello,

     This is strange it is showing all workflow activities at my end. Is the visual studio installation full with all features?

    Regards,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    08 Feb 2012
    Link to this post
    As far as I remember, yes, but I can double check. Is the workflow stuff optional?

    VS 2010 Professional Edition with Service Pack 1 if that helps.

    Thanks,
    Chris
  11. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    24 Feb 2012
    Link to this post
    I think I about have this.

    One weird behavior I was noticing: when I attempted to create a new VirtualPath, I was getting FileNotFound exceptions. When I changed it back to the default, though, I would also get FileNotFound exceptions. I solved this by just changing the default virtual path (~/DefaultWorkflows/PagesApprovalWorkflow.xalmx) to point to the correct file in my assembly rather than the Telerik default. Still, rather weird behavior that I thought I should point out.

    Thanks,
    Chris Aumiller
  12. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    28 Feb 2012
    Link to this post
    Hello,

     I suppose the problem with file not found exception was caused by improper configuration change as when trying to save a path to the workflow there is no regular expression check if the path contains a file with .xamlx extension (also I tried to change the default workflow paths with correct and incorrect paths) .

    Are you able to create .xamlx project and view the .xamlx file at your end. I am not sure if I suggest something of help as the .xamlx file is read only and sitefinity doesn`t provide and logic to aid in rendering it in visual studio.

    All the best,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  13. Beth
    Beth avatar
    25 posts
    Registered:
    20 Aug 2012
    23 May 2013 in reply to Chris
    Link to this post
    For this -

    default virtual path (~/DefaultWorkflows/PagesApprovalWorkflow.xalmx) to point to the correct file in my assembly

    - What did that look like in the settings?
  14. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    28 May 2013
    Link to this post
    Hello,

    The virtual path to the embedded workflow for pages located in Telerik.Sitefintiy.Workflow.Workflows.PagesApprovalWorkflow.xamlx is accessible trough settings in (here is a screenshot). I am not sure if I understood the question correctly so please explain again if this is not what you meant.

    Regards,
    Stanislav Velikov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
14 posts, 0 answered