ReCaptcha fires after Workflow event

Topics: Customizing Orchard
Feb 19, 2015 at 6:48 AM
Hi There

I am using Orchard 1.7.2 and cannot upgrade at this moment in time.

I have a form with a ReCaptcha content part.

My issue is that the recaptcha works correctly and stops the content from being created but the workflow still fires and sends of an email even though the contentitem was not created.


Create a custom form with a recaptcha content part.
Create workflow on Content Created send email.
Submit form without completing recaptcha.
Email still sends.

Is there a way to stop the workflow item when the recaptcha fails.
 var submitViewModel = new ReCaptchaPartSubmitViewModel();

            if(updater.TryUpdateModel(submitViewModel, String.Empty, null, null)) {
                var context = workContext.HttpContext;

                var result = ExecuteValidateRequest(

                if(!HandleValidateResponse(context, result)) {
                    updater.AddModelError("Parts_ReCaptcha_Fields", T("The text you entered in the Captcha field does not match the image"));
                    //stop workflow