I am building an add-on to an events module that checks for availability, since there wasn't a function for that in that module. Now that I have built the logic, there are three emails I will need to send:
One if the post is being submitted for the first time (ie 'New appointment')
One if the post has been published by the site admin, as normal users won't be able to publish by themselves (ie 'Your appointment has been approved')
- One for if the post has been edited, AFTER it has been published already (ie 'Your appointment has been edited')
I have hooked into save_post and publish_post for those first two, but I want an entirely different email sent upon editing a PUBLISHED post. How can I test for whether the post is already published and this is just an edit, versus it being published for the first time?