Support

Account

Home Forums ACF PRO email the customer who purchased the product when the custom field is updated

Solving

email the customer who purchased the product when the custom field is updated

  • hi everyone

    when I changed or updated the custom field in a product (for example the version number field), I want to send an e-mail to the user who bought that product, about the update in the product. How can I do this ?

    thank you in advance

  • hi , i really need help with this

  • The answer to that question hinges on being able to have a record of all of the orders made, who made them and being able to get a list of those that ordered a specific product. This would be dependent on what you are using for orders and the answer to this would come from there.

    Given the ability to do the above you would create an acf/save_post action that looked for changes to the field in question and when a change is made then get the above list and use wp_mail() to send each of those people an email.

  • To add to this, are you using WooCommerce for products and orders?

    If so, a pseudo answer would be something like:

    Look at transition_post_status
    When the post is updated, you need to get the post ID

    You then need to Get List of WooCommerce Customer Emails Who Purchased a Specific Product

    Now you have the customer email, you can use wp_mail()

    Hope that helps!

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

You must be logged in to reply to this topic.