0
votes

I have an existing publishing site with content approval enabled and already implemented event receivers. Approvers are creating content and publishing directly. However, authors are creating content too, they only can submit for approval. I want to send an email when someone submits an item for approval. Sounds easy... But, the e-mail should not be sent if the item is published directly. When I debug ItemUpdated and check the properties.ListItem.ModerationInfo on both actions (Publishing and Submit for Approval) gets "Pending"; when Published the event ItemUpdated fires again and the status is Approved. How do I accomplish that only an email is sent when submitted for approval?

I tried with a custom list workflow created in SPDesigner, that works, but that is not deployable and is overkill. I just want to check that final state = Pending. Please help...

I've seen this: SharePoint - checking Content Approval change status in event receiver that is not enough...

1
Commercial tool to do this - pentalogic.net/sharepoint-products/reminder/…Ryan

1 Answers

0
votes

Have you looked at the ItemUpdating event? You can then intercept the event and based on your condition, you can then set the properties of that item.

Another option would be to create a simple custom workflow. This can be done even in SharePoint Designer. You can then either make it manual or automatic. Any time an item changes in your list, the first thing it can do would be check to see if something was submitted to be approved. If it has, then send an email. Make the workflow hang out until an action has come back from whomever the email was sent to, or just let it continue going on asynchronously depending on your detailed requirements.