MightyMouseofGod Posted September 25, 2023 Share Posted September 25, 2023 I think my newsletter signup at the bottom of my homepage stopped working when we upgraded Prestashop to 1.7.8.10 and Mailchimp to v3.0.7 (it had been on 2.something previously). When you type in an email address and hit SUBSCRIBE it just reloads the home page and the email address doesn't appear in Prestashop or Mailchimp. Looking into configuring the module it complained that I had 2 stores using the same Mailchimp list and I fixed that in the way it suggested. It's still asking me to press the Sync button. I'm more than a little concerned that although it shows the right number of products to sync in the list in Store Sync, there are far fewer customers and subscribers than there are in Prestashop or Mailchimp. I have exported a contact list from Mailchimp as a backup but I'd still like to understand a bit more about what is going on. I can give a temporary password to anyone willing to help. Thanks Debbie Link to comment Share on other sites More sharing options...
AddWeb Solution Posted October 9, 2023 Share Posted October 9, 2023 Hi, Firstly, Make sure that your Mailchimp API key is correctly configured in your Prestashop module settings. Verify that the Mailchimp list ID is correctly set up in your PrestaShop module. If the module is asking you to press the "Sync" button, it's possible that there's a synchronization issue between PrestaShop and Mailchimp. Try clicking the "Sync" button to initiate a manual synchronization. In Mailchimp, check that the list you are syncing with Prestashop is set up correctly. Ensure that the list is active and able to receive new subscribers. Clear the cache in Prestashop. Thanks! Link to comment Share on other sites More sharing options...
Knowband Plugins Posted October 10, 2023 Share Posted October 10, 2023 Hi Recently Mailchimp Version was upgraded to a newer version from V2 to V3. Now the way of fetching the list and updating the list has completely changed. For Adding new users to the list try the below code $api_key = // Your API KEY; $list_id = // Your List ID; $Mailchimp = new Mailchimp($api_key); $result = $Mailchimp->post("lists/$list_id/members", array( 'email_address' => trim($email), 'status' => 'subscribed', ) ); $subscriber_hash = $Mailchimp->subscriberHash(trim($email)); $Mailchimp->patch("lists/$list_id/members/$subscriber_hash", array('merge_fields' => array('FNAME' => $first_name, 'LNAME' => $last_name))); For fetching the list you can refer to the below code public function mailchimpGetLists($api_key = null) { if (trim($api_key) != '' && $api_key !== null) { try { $Mailchimp = new Mailchimp($api_key); $lists = $Mailchimp->get('lists'); if ($lists !== false) { $options = array(); foreach ($lists["lists"] as $list) { $options["success"][] = array( 'value' => $list["id"], 'label' => $list["name"] ); } } else { $options["error"][] = array( 'value' => "0", 'label' => $this->l("No list found. (Verify Credentials)") ); } } catch (\Exception $e) { $options["error"][] = array( 'value' => "0", 'label' => $e->getMessage() ); } } else { $options["error"][] = array( 'value' => "0", 'label' => $this->l("No list found. (Verify Credentials)") ); } return $options; } For using the code when the below library is imported to the desired location you can simply include the library like below include_once(dirname(__FILE__) . '/libraries/drewm/mailchimp-api/src/MailChimp.php'); I've attached the library here with the email which you can use in your code. mailchimp-api.zip Link to comment Share on other sites More sharing options...
MightyMouseofGod Posted July 1, 2024 Author Share Posted July 1, 2024 On 10/9/2023 at 11:10 AM, AddWeb Solution said: Hi, Firstly, Make sure that your Mailchimp API key is correctly configured in your Prestashop module settings. Verify that the Mailchimp list ID is correctly set up in your PrestaShop module. If the module is asking you to press the "Sync" button, it's possible that there's a synchronization issue between PrestaShop and Mailchimp. Try clicking the "Sync" button to initiate a manual synchronization. In Mailchimp, check that the list you are syncing with Prestashop is set up correctly. Ensure that the list is active and able to receive new subscribers. Clear the cache in Prestashop. Thanks! Hi, sorry for the late reply - I've been unwell for a while but getting back into things now. I didn't have an API in Mailchimp when I looked, but have now generated one. I can't see where in the Prestashop Mailchimp module I put the API. Prestashop version is currently 1.7.8.11 Mailchimp Module v3.0.16 Cache cleared It's not apparently asking me to sync. The Mailchimp side of things seems to be working OK Link to comment Share on other sites More sharing options...
MightyMouseofGod Posted July 1, 2024 Author Share Posted July 1, 2024 I'm not sure I understand what knowband sent and I would not have expected to do anything that complicated to get an official module working Thanks Debbie Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now