• Resolved Christian Denat

    (@yakafaucon)


    Hello,

    I’m workng on a theme where I want to integrate Mailpoet subscription with a Forminator form.

    For this I’m using ‘forminator_custom_form_before_save_entry’ and ‘forminator_custom_form_before_handle_submit’ actions. All the basics are working, ie I’m able to subscribe to the right list and catch all the errors/warnings from mailpoet when there are some.

    For the moment, the form is just displaying message from Forminator (standard success and error messages) but I want to display the specific messages (ie, subscribed, already subscribed ..) got from mailpoet.

    Where can I find some code sample that could help me to manage such things using the ‘forminator_custom_form_ajax_submit_response’ filter (or any more appropriate) ?

    THanks for the help !

    Regards.

    Christian

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @yakafaucon

    I hope you’re doing well!

    Please try using forminator_custom_form_ajax_submit_responsefilter for display custom message. Please see this example:

    add_filter( 'forminator_custom_form_ajax_submit_response', function( $response, $form_id, $type ) {
    	if ( 917 === (int) $form_id ) {
    		$response['message'] = 'already subscribed';
    	}
    	return $response;
    }, 20, 3 );

    Additionally, an error message can be shown and restrict save an entry with this filter:
    forminator_custom_form_submit_errors

    Hope this helps!

    Kind regards,
    Nastia

    Hello @yakafaucon

    I hope you are doing well!

    We haven’t heard back from you for a while now so we’ve marked this ticket as resolved. If you do have any followup questions or require further assistance feel free to reopen it and let us know here.

    Kind regards,
    Nastia

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Managing errors using the API’ is closed to new replies.