If you decompile the Sitecore Kernel, you will see three variables that you can use in your email action out of the box:
However, for many people the need arises to have use their own. This post describes how to do so.
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.
Now that you have your custom action written, it’s time to wire it up in Sitecore. This requires extremely little effort.
- Navigate to the command you wish to add your action below.
- Insert a new email action. This is located at /sitecore/templates/System/Workflow/Email action
- Fill out the fields with desired information. Remember to use $variableName$ when using your variables in the message field.
- Fill out the Type field with the assembly qualified type name of your new class as shown above.
Thanks for reading!