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.

  • 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 Aug 8 '20 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
    Aug 9 '20 at 10:46

There'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 email
  • get_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

  • please check the update and thank you for pointing me in the right direction Aug 8 '20 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.