function mailchimp_get_marketing_permissions in Mailchimp 7.5
Same name and namespace in other branches
- 8 mailchimp.module \mailchimp_get_marketing_permissions()
- 2.x mailchimp.module \mailchimp_get_marketing_permissions()
Get the marketing permissions for a subscribed member
Simple wrapper around mailchimp_get_memberinfo().
Parameters
string $list_id: Unique string identifier for the list on your MailChimp account.
string $email: Email address to check for on the identified MailChimp List.
bool $reset: Set to TRUE to ignore the cache. (Used heavily in testing functions.)
Return value
array An array of marketing permissions, or an empty array if not subscribed
1 call to mailchimp_get_marketing_permissions()
- mailchimp_subscribe_process in ./
mailchimp.module - Wrapper around MailchimpLists::addOrUpdateMember().
File
- ./
mailchimp.module, line 677 - Mailchimp module.
Code
function mailchimp_get_marketing_permissions($list_id, $email, $reset = FALSE) {
$marketing_permissions = [];
$memberinfo = mailchimp_get_memberinfo($list_id, $email, $reset);
if (isset($memberinfo->status) && $memberinfo->status == 'subscribed' && isset($memberinfo->marketing_permissions)) {
$marketing_permissions = $memberinfo->marketing_permissions;
}
return $marketing_permissions;
}