i am trying to add an user to a MailChimp list programmatically (so he is a subscriber of any emails i will send).
I do have the pro-version of the MailChimp for WordPress plugin.
Is there a way to add – and remove a user (Email and three fields) to a list dynamically?
There seems to be an API (http://developer.mc4wp.com/), but i did not found a function to do so.
Is there one?
Use the
mc4wp_get_api
function to grab an instance of the MailChimp for WordPress API. Then call thesubscribe()
function add an email to a list:subscribe()
function returns a boolean. This return value simply reports if the subscribe request succeeded. Will returnfalse
if the user is already on the list$list_id
can be found when logged into MailChimp, looking under a list,Settings > List name and campaign defaults > List ID