Home › Forums › General Issues › Email User within a user field › Reply To: Email User within a user field
General outline
1) Create an acf/save_post action that fires before ACF has saved values (priority < 10)
2) New field value will be in $_POST['acf'][$field_key]
. Get old value of field using get_field()
. The new value for a user field will be an array of user IDs.
3) Compare the old value with the new value to see what users have been added to the array.
4) Use wp_mail() to send an email to the added users.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.