Is it possible to allow a remote post handler to prevent executing other email/remote handler if it fails? Right now I have a use case where there are email handlers as well and it would send out thank you email even though the remote post couldn't be completed. It would be great if there is for example a checkbox in the remote post handler configuration to have this option. Or in the handler condition setting to have an option to check for other handler's return status.

If the above feature request is not possible, what is the best way for a remote post handler to halt the whole submission process when for example the remote URL return 500 or 404 error if I have a custom remote post handler?

Comments

andrechun created an issue. See original summary.

jrockowitz’s picture

The problem is that the remote post request happens after the submission is processed and stored in the database.

You might need to extend the remote post handler and trigger the remote post via the form validation before anything else is executed.

Beware when remote posting during the validation step, multistep forms are validated repeatedly.

andrechun’s picture

In my case, I am not storing the submission data into the Drupal database. It is stored in the remote server. So I just need to find a way to not trigger the rest of the handlers.

jrockowitz’s picture

You could extend the remote post handler and set hidden element value based on the remote post's response and conditional enable/disable other handlers.

jrockowitz’s picture

Status: Active » Closed (works as designed)