pramilaniroshan
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Plugins
In reply to: [Contact Form to Any API] Show Back end response in WordPress UIHi @mayur8991 ,
we can do something like this. we can add a “wpcf7_display_message” filter if our back-end conditions are met.
class-cf7-to-any-api.php -> line number 169
$this->loader->add_action('wpcf7_before_send_mail',$plugin_admin,'cf7_to_any_api_send_data_to_api');
class-cf7-to-any-api-admin.php > add this after line number 634
if($result) { $api_response = json_decode( $result, true ); if(in_array("400", $api_response)){ add_filter('wpcf7_display_message', 'change_submission_msg',10,2); function change_submission_msg($message, $status){ if('mail_sent_ok' == $status){ $message= 'We are unable to proceed with your request. Because the email address you entered is already on our server - so you probably have an account with us.'; } return $message; } }
using that we can manage API side errors to display on cf7 forms like validation messages on fronted.
Thanks,
Pramila.
Forum: Plugins
In reply to: [Contact Form to Any API] Show Back end response in WordPress UI@mayur8991 Thanks for the reply. I saw that we can change the plugin action.but my question is can we stop submitting the form and display the backend error message when backend/spring boot app throw an error?
Thanks.
@prashantrai Thanks so much. we are able to fix this using a external API.
Yes, I am really sorry I couldn’t reply you to back, My issue is fixed,
Thank You..!
Viewing 4 replies - 1 through 4 (of 4 total)