Re: MailChimp Newsletter Sidebox
Quote:
In the specific case of MooSend though, please coordinate with them, since they did the integration for us.
Yes, I understand. The problem is that these "service suppliers" (not only MooSend) are not getting much interest from Zen Cart users (since the user-base has gone down). So they kinda abandoned these updates and development.
I installed that module a couple of months ago and I had to disable it because it was not compatible (it made my cart inoperable, it will not let you checkout). There was no error logs so I couldn't tell them what exactly was happening. Since there are not a lot of people asking and/or using it, they would not proceed to update the module.
Quote:
The more the merrier. When I did this work, MailChimp was the only game in town for SMBs; now there are lots of options.
I'd love to see more integration work.
I know, and that's why I mentioned MooSend because there's also an integration for ZC but nobody talks about it.
Re: MailChimp Newsletter Sidebox
Quote:
Originally Posted by
simon1066
I've had to give up on being able to have changes of email address in ZC updated on Mailchimp's member's list (although I've confirmed that PATCH is functioning I'm unable to get the change of email to work). I thought I would post my documentation on this tweak to @swguy's mod.
Thanks for working this out Simon, I will integrate it this week :-)
1 Attachment(s)
Re: MailChimp Newsletter Sidebox
Passing Marketing Permissions (GDPR) from ZC customer account to Mailchimp
In Mailchimp there is an option to enable compulsory Marketing Permissions (GDPR) checkbox(es) on a sign-up form in order to capture explicit consent to receive emails - this basically 'time-stamps' the consent for later use if needed. It would be useful to pass this explicit consent from a ZC customer account (once they have accepted the relevant GDPR privacy notice) to Mailchimps member list, so see the code below.
It is common for the explicit consent to be captured by selecting from various marketing avenues such as:
Attachment 19882
at least one of these HAS to be selected. In my case I only have one avenue (email) so the following code reflects this:
The relevant marketing permission has a 'marketing_permission_id' field which is needed and can be obtained from the output of an API call. Paste this code (updating the xxxxx) into a new php file and visit it in a browser.
Code:
<?php
$api_key = 'xxxxxxxxxxxxxxxxxxxx'; // your api key
$server = 'xxxx.'; // your server - something like 'us20', usually found at the end of the API key
$list_id = 'xxxxxxxx'; // your list id
$email = 'xxxmy_email_addressxxxxx';
$auth = base64_encode( 'user:'.$api_key );
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://'.$server.'api.mailchimp.com/3.0/lists/'.$list_id.'/members');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json',
'Authorization: Basic '.$auth));
curl_setopt($ch, CURLOPT_USERAGENT, 'PHP-MCAPI/2.0');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
$result_obj = json_decode($result);
foreach ($result_obj->member as $obj) {
echo $obj->id . ' - ' . $obj->name;
echo '<br />';
}
echo '<pre>'; print_r($result_obj); echo '</pre>';
?>
includes/functions/extra_functions/mailchimp.php
Code:
public function list_add_subscriber(Array $options)
{
// Check required params
if ( ! isset($options['id_list']) OR ! isset($options['email']))
{
throw new MailChimpException('Parameters not set on '.__METHOD__);
}
$endpoint = '/lists/' . $options['id_list'] . '/members/';
$payload = [
'email_address' => $options['email'],
'status' => 'subscribed',
'marketing_permissions' => array([
'marketing_permission_id' => 'xxxxxxxxx',
'enabled' => true
])
// 'status' => isset($options['status']) ? $options['status'] : 'pending',
];
if (isset($options['merge_fields']) AND $options['merge_fields'])
{
$payload['merge_fields'] = $options['merge_fields'];
}
return $this->_execute_request('POST', $endpoint, $payload);
}
There may be a tidier way to do it, that's all I could manage.
This now passes the marketing permission consent from a customers ZC account to Mailchimps members list.
Re: MailChimp Newsletter Sidebox
If your customers or products can be easily segmented, you might want to look at MailChimp's Groups feature. You can add Groups to your audience and allow people to self-segment. The signup form when groups are configured will include radio buttons/checkboxes so people can indicate the groups they want to join; then you can segment your audience by groups when creating and sending a newsletter.
Re: MailChimp Newsletter Sidebox
Will this version work for 1.5.7d?
Thanks!
Re: MailChimp Newsletter Sidebox
Re: MailChimp Newsletter Sidebox
Re: MailChimp Newsletter Sidebox
Hi,
I am trying to configure this on Zen Cart v1.5.6c. I am stuck on the Mailchimp side of it as my Form does not have any bot prevention code at the bottom as per your instructions. Here is a link to my Form. What am I doing wrong please?
Kind regards :-)
Re: MailChimp Newsletter Sidebox
Quote:
Originally Posted by
cjsmiff
Hi,
I am trying to configure this on Zen Cart v1.5.6c. I am stuck on the Mailchimp side of it as my Form does not have any bot prevention code at the bottom as per your instructions.
Here is a link to my Form. What am I doing wrong please?
Kind regards :-)
UPDATE: well now, the Zen Cart Create Account page works fine without the bot prevention code and I don't need the sidebox so haven't tested it, but would imagine if one works then the other should too...
Re: MailChimp Newsletter Sidebox