• Resolved mano03

    (@mano03)


    I need to add the result of a function in the successful sending message, I am using the forminator_custom_form_submit_before_set_fields function to calculate and I want to show its result in the success message.
    can you help me?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @mano03,

    I have passed your questions over to our devs so they can have a look and see if there’s a quick way of doing this or if it would require custom development.

    We will update you here once we have further information.

    Cheers,
    Predrag

    Hi @mano03,

    Can you check if something like this would do the trick:

    function wpmudev_forminator_custom_submit_msg( $response, $form_id ) {
    
        if ( isset( $_REQUEST[ "formy_response_{$form_id}" ] ) ) {
            $response['message'] = $_REQUEST[ "formy_response_{$form_id}" ];        
        }
        
        return $response;
    }
    
    add_filter( 'forminator_custom_form_submit_response', 'wpmudev_forminator_custom_submit_msg', 20, 2 );
    add_filter( 'forminator_custom_form_ajax_submit_response', 'wpmudev_forminator_custom_submit_msg', 20, 2 );
    
    add_action( 'forminator_custom_form_submit_before_set_fields', function( $entry, $form_id, $field_data_array ){
    
        // Manage entry
        // If needs to update response message:
        $_REQUEST[ "formy_response_{$form_id}" ] = 'The new response message';
    
    },20 , 3 );

    You would need to set new value for
    $_REQUEST[ "formy_response_{$form_id}" ]

    Hope this helps.

    Cheers,
    Predrag

    Plugin Support Imran – WPMU DEV Support

    (@wpmudev-support9)

    Hello @mano03,

    I hope you’re doing well!

    We’ve not heard from you in a while. I’ve marked this ticket as resolved for now, but if you need anything else at all, we’re here for you, please just reopen the ticket or create a new one.

    Have a good day and take care!

    Cheers,
    Nastia

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘custom messaje’ is closed to new replies.