I am trying to customise the success message of the Contact Form 7 plugin in WordPress.
I understand that it could be done using javascript, but I don't have this option. That's because I've created a custom coupon code on form submission, by using this - add_action('wpcf7_mail_sent', 'dbo_generate_coupon');
.
I need to display that coupon to the user after the form is sent.
I don't want to use an alert. I need to alter the standard "Thank you for your message. It has been sent." response.
I am confident I can retrieve the cookie ok, but the first ( simple? ) step is getting control of the success message. Here I'm out of my depth.
I've tried code like
return apply_filters('wpcf7_messages','dbo_update_form_messages',10,1);
and
add_action('wpcf7_before_send_mail', 'action_wpcf7_mail_sent', 10, 1);
add_action('wpcf7_mail_sent', 'action_wpcf7_mail_sent', 10, 1);
Clearly I need help.
Thanks in advance.