Extending Sitecore Workflow Email Action

If you decompile the Sitecore Kernel, you will see three variables that you can use in your email action out of the box:

  • $itemPath$
  • $itemLanguage$
  • $itemVersion$

However, for many people the need arises to have use their own.  This post describes how to do so.

Code:

You can add your own variables by replacing the token “$variableName$” with the value that you need.  See my example of getting the current item’s URL on line 51.

Setup:

Now that you have your custom action written, it’s time to wire it up in Sitecore.  This requires extremely little effort.

  1. Navigate to the command you wish to add your action below.
  2. Insert a new email action.  This is located at /sitecore/templates/System/Workflow/Email action 

    SelectEmailAction

  3. Fill out the fields with desired information.  Remember to use $variableName$ when using your variables in the message field.

    FilledOutEmailAction

  4. Fill out the Type field with the assembly qualified type name of your new class as shown above.

Thanks for reading!

Advertisements

One thought on “Extending Sitecore Workflow Email Action

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.