回显自定义响应消息,发送电子邮件前请联系表格7 [英] Echo Custom response message , contact form 7 before send email hook
本文介绍了回显自定义响应消息,发送电子邮件前请联系表格7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在contactform7下方或上方显示自定义消息,而不发送电子邮件.我使用before_send_email函数使它感到厌倦,但是没有任何效果.下面是我使用的功能.
I want to show a custom message below or above contactform7, without sending the email. I tired it using before_send_email function, but nothing is working. below is the function I have used.
add_action("wpcf7_before_send_mail", "wpcf7_do_something_else");
function wpcf7_do_something_else($cf7) {
$wpcf->skip_mail = true;
// Here I tried to use jquery or wordpress filter function to display custom message. but nothing is displaying.
return $wpcf;
}
请帮助
推荐答案
要在表单提交中返回自定义消息,可以使用过滤器 wpcf7_ajax_json_echo
to return a custom message on the form submission, you can use the filter wpcf7_ajax_json_echo
尝试:
add_filter("wpcf7_ajax_json_echo", function ($response, $result) {
$response["message"] = "a custom message";
return $response;
});
这篇关于回显自定义响应消息,发送电子邮件前请联系表格7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文