I would change the approach, and as @jammykam mentioned, implement it as an action.The sample workflow, already comes with an action to send emails here: /sitecore/system/Workflows/Sample Workflow/Awaiting Approval/Approve with Test/Action
It is using the class Sitecore.Workflows.Simple.EmailAction, Sitecore.Kernel
. I would create my own action using that one as an example, or even inheriting from it.
You have to implement the process method, which receives an object of type WorkflowPipelineArgs
. In this object, you have the property CommentFields
, a string dictionary with the comments of each field.Once you collect those fields, it is easy to include them in the email.