Support

Account

Home Forums General Issues Notify User

Helping

Notify User

  • I was having a dabble at creating a proofing area so people can critique blog posts. I’ve set up a field called approved users which allows me to select users I’d like to preview a post, so when they login they can see the posts they’re approved to see, I was wondering is there a way to get the users from this custom field and notify them via email when a post goes live that they can give feedback on?

    I stumbled across this forum post but that seems to take a single user email, where as I’d be looking to source the emails from a user field, which there could be anywhere from 1 – 20 users.

    https://support.advancedcustomfields.com/forums/topic/send-email-when-status-turns-from-draft-to-published/

    Any pointers appreciated, thanks 🙂

  • the function wp_mail() can take an array or a comma separated list of emails to sent the email to https://developer.wordpress.org/reference/functions/wp_mail/.

    You would need to get the users that you want to email. How you do that would depend on where and how they are set. If you’re using a user field the you’d need to get the users selected in that field and loop through them to get the list of email addresses.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.