admin管理员组文章数量:1326053
I have added a custom field "Registered"(field type = checkbox) through ACF on Post Type.
When I change the value of the custom post field "Registered" with a check, I want to send email notification to the User Email. Can this be done in any way. I am not too familiar with coding.
I have added a custom field "Registered"(field type = checkbox) through ACF on Post Type.
When I change the value of the custom post field "Registered" with a check, I want to send email notification to the User Email. Can this be done in any way. I am not too familiar with coding.
Share Improve this question edited Aug 10, 2020 at 18:14 Nate Allen 2,1062 gold badges16 silver badges23 bronze badges asked Aug 7, 2020 at 12:58 Muhammad Aurangzeb KhanMuhammad Aurangzeb Khan 11 bronze badge 2- do_action('on_acf_post_save'); function on_acf_post_save() { $pid = get_the_ID(); $post_type = get_post_type($pid); $value = get_field('email_sent_indicator', $pid); $value = 'test'; if ($post_type == 'listing-item') { update_field('email_sent_indicator', $value); } } --------------------- I have added this function now, thanks to "mozboz". But heres the thing I cannot update the field of acf. I have tried with "acf/save_post" and also this do_action but both are not updating the value of the field "email_sent_indicator". Btw its a text field in acf – Muhammad Aurangzeb Khan Commented Aug 8, 2020 at 21:45
- It's not readable to add so much code to a comment like this - it's best to make a new question with your code and a new specific question in it. – mozboz Commented Aug 9, 2020 at 10:46
1 Answer
Reset to default 2There's no way to do this without a bit of programming. You need to look at these pieces:
- A Wordpress hook like
save_post
lets you do something when a post is saved or updated wp_mail
is how you send an emailget_field
is how you look at the value of an ACF field.
You'd need to write some code to put them together how you want to, but the details of doing that are beyond the scope of this stack and you'd need to learn some coding, how to run code in Wordpress through a plugin or functions.php
版权声明:本文标题:plugin development - Send a conditional email notification when a custom field value changes in Post Type 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742198770a2431568.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论