Requirements:
- When a new post is created, a new mailing list is created in Mailchimp
- When the new mailing list is created in Mailchimp, the list ID is stored in the post's metadata
- When the post is viewed, the unique mailing list ID is used to create a mailing list subscription form on the page
Questions:
- What's the best WP hook to use to run the function every time a new post is created, and ONLY when it is created (not updated)? (This Stack Overflow post recommends the
transition_post_status
hook.) - The Mailchimp API is used to create new mailing lists. Is there an open-source wrapper class it?
- What's the best way to store the unique mailing list list ID so that it is stored in the post's metadata?
add_post_meta()
?