Custom Workflow Notification Email

Posted by Community Admin on 04-Aug-2018 18:28

Custom Workflow Notification Email

All Replies

Posted by Community Admin on 23-Jan-2012 00:00

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

Posted by Community Admin on 24-Jan-2012 00:00

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

Posted by Community Admin on 24-Jan-2012 00:00

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

Posted by Community Admin on 24-Jan-2012 00:00

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.

Posted by Community Admin on 26-Jan-2012 00:00

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

Posted by Community Admin on 26-Jan-2012 00:00

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

Posted by Community Admin on 30-Jan-2012 00:00

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

Posted by Community Admin on 07-Feb-2012 00:00

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

Posted by Community Admin on 08-Feb-2012 00:00

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

Posted by Community Admin on 08-Feb-2012 00:00

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

Posted by Community Admin on 24-Feb-2012 00:00

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

Posted by Community Admin on 28-Feb-2012 00:00

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

Posted by Community Admin on 23-May-2013 00:00

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?

Posted by Community Admin on 28-May-2013 00:00

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

This thread is closed