Page 39 of 40 FirstFirst ... 2937383940 LastLast
Results 381 to 390 of 393
  1. #381
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    434
    Plugin Contributions
    0

    Default Re: MailChimp Newsletter Sidebox

    I've been using Mailchimp for years, but need to add it now to our new website that uses the Fluorspar template. So far I have not been successful. When I enable it in the Layout Boxes Controller, it wipes out the center box in the Fluorspar display. Has anyone else been able to install this in a Fluorspar template?

  2. #382
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    8,155
    Plugin Contributions
    9

    Default Re: MailChimp Newsletter Sidebox


  3. #383
    Join Date
    Mar 2004
    Posts
    194
    Plugin Contributions
    0

    Default Re: MailChimp Newsletter Sidebox

    ok is this suppose to have a box to put an email in, it goes to another page to add info...
    did i do something wrong...
    i followed software guys instructions on his web site.

    in the attachments shows the subscribe box
    and when clicking the subscribe it goes to a second page

    now when creating forms on mailchimp,, i did the condensed verson so only the email was suppose to show up.

    ok.. any more info you need please ask..
    thank you so much.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screenshot 2021-10-03 9.08.29 PM.jpg 
Views:	82 
Size:	45.0 KB 
ID:	19746   Click image for larger version. 

Name:	Screenshot 2021-10-03 9.18.40 PM.jpg 
Views:	77 
Size:	25.7 KB 
ID:	19747  
    My Multi_Site Zen Carts
    http://herasonlinemarket.com

  4. #384
    Join Date
    Feb 2009
    Location
    UK
    Posts
    945
    Plugin Contributions
    0

    Default Re: MailChimp Newsletter Sidebox

    This is a bit of an ask but would anyone be able to share how, using v3 of the API, to update a members email address in the MailChimp list when it is edited in ZC's account_edit page. I believe this can be achieved by using the API's 'PATCH' command. This post has a solution for an earlier API version - which I've attempted to adapt, without success.
    Simon

  5. #385
    Join Date
    Feb 2009
    Location
    UK
    Posts
    945
    Plugin Contributions
    0

    Default Re: MailChimp Newsletter Sidebox

    Quote Originally Posted by simon1066 View Post
    This is a bit of an ask but would anyone be able to share how, using v3 of the API, to update a members email address in the MailChimp list when it is edited in ZC's account_edit page. I believe this can be achieved by using the API's 'PATCH' command. This post has a solution for an earlier API version - which I've attempted to adapt, without success.
    Here's what I have so far:

    templates/tpl_account_edit_default.php
    Code:
    <?php echo zen_draw_hidden_field('email_address_old', $account->fields['customers_email_address'], 'id="email-address-old"') ?>
    pages/account_edit/header_php.php
    Code:
    mailchimp_update($email_address_old, $email_address);  
    
    $zco_notifier->notify('NOTIFY_HEADER_ACCOUNT_EDIT_UPDATES_COMPLETE');
    extra_functions/mailchimp_functions.php
    Code:
    function mailchimp_update($email_address_old, $email) {
        $mailchimp = new MailChimp(BOX_MAILCHIMP_NEWSLETTER_API_KEY);
    
        $reply = $mailchimp->list_update_subscriber([
           'id_list' => BOX_MAILCHIMP_NEWSLETTER_ID,
           'email' => $email,
    	   'status' => 'subscribed'
        ]);
    
        if (isset($reply->type)) { 
            $errorMessage = "Unable to run update_subscriber command()!\n" . 
               "\tMsg=" . print_r($reply, true) . "\n";
              $file = DIR_FS_LOGS . '/' . 'MailChimp.log';
              if ($fp = @fopen($file, 'a')) {
                fwrite($fp, $errorMessage);
                fclose($fp);
              }
        }
     }
    extra_functions/mailchimp.php
    Code:
    public function list_update_subscriber(Array $options)
        {
            // Check required params
            if ( ! isset($options['id_list']) OR ! isset($options['email']))
            {
                throw new MailChimpException('Parameters not set on '.__METHOD__);
            }
            $subscriber_hash = md5(strtolower($options['email'])); 
            $endpoint = '/lists/' . $options['id_list'] . '/members/' . $subscriber_hash;
           $payload = [
                'email_address' => $options['email'],
                'status' => 'subscribed'           
            ];
            
            return $this->_execute_request('PATCH', $endpoint, $payload);
        }
    If I use 'PUT' instead of 'PATCH' it adds the new address to the Mailchimp members list - so I guess something is working.
    Simon

  6. #386
    Join Date
    Feb 2009
    Location
    UK
    Posts
    945
    Plugin Contributions
    0

    Default Re: MailChimp Newsletter Sidebox

    ZC v1.5.7c
    PHP v7.3

    I've updated my mailchimp.php with the patch for PATCH from @swguy's github contribution. I'm guessing that the issue lies somewhere in the other three edited files.
    Last edited by simon1066; 7 Jan 2022 at 09:55 AM. Reason: Versions
    Simon

  7. #387
    Join Date
    Feb 2009
    Location
    UK
    Posts
    945
    Plugin Contributions
    0

    Default Re: MailChimp Newsletter Sidebox

    Quote Originally Posted by simon1066 View Post
    ZC v1.5.7c
    PHP v7.3

    I've updated my mailchimp.php with the patch for PATCH from @swguy's github contribution. I'm guessing that the issue lies somewhere in the other three edited files.
    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.

    Mailchimp allows for a list of subscribers to be segregated (into Groups) based on the selection made when completing the sign-up form, such as:

    Click image for larger version. 

Name:	Screenshot 2022-01-09 145041.png 
Views:	6 
Size:	7.4 KB 
ID:	19878

    This is useful for sending different newsletters to different subscribers. However, if a subscriber signs up for newsletters on a ZC website, no groups are transferred to Mailchimp - meaning those subscribers will be missed if solely relying on groups to send newsletters.

    Until I manage (not guaranteed) to add the relevant checkboxes to the account_newsletters page I have assumed that a subscriber on my website will automatically be signed up for both groups (wording the descriptive text on the signup page accordingly). To achieve this here are the relevant code additions (in red):

    includes/languages/english/extra_definitions/mailchimp_sidebox_defines.php
    Code:
    define('BOX_MAILCHIMP_NEWSLETTER_ID','xxxxxxxxxx');  
    define('BOX_MAILCHIMP_NEWSLETTER_U','yyyyyyyyyy');  
    define('BOX_MAILCHIMP_NEWSLETTER_URL','http://YourSite.us1.list-manage.com/subscribe/post');  
    define('BOX_MAILCHIMP_NEWSLETTER_API_KEY','xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
    
    define('MAILCHIMP_INTEREST_ID_A','aaaaaaaaaaa'); 
    define('MAILCHIMP_INTEREST_ID_B','bbbbbbbbbbb');  
    
    // Language defines for newsletter sidebox
    define('BOX_HEADING_MAILCHIMP_SIDEBOX', 'Newsletter'); 
    define('BOX_MAILCHIMP_PITCH', 'Subscribe to our newsletter for periodic updates and valuable coupons.'); 
    define('BOX_MAILCHIMP_SUBSCRIBE', 'Subscribe');
    includes/functions/extra_functions/mailchimp_functions.php
    Code:
     function mailchimp_add($email) {
        $mailchimp = new MailChimp(BOX_MAILCHIMP_NEWSLETTER_API_KEY);
        $reply = $mailchimp->list_add_subscriber([
           'id_list' => BOX_MAILCHIMP_NEWSLETTER_ID,
           'interest_id_A' => MAILCHIMP_INTEREST_ID_A,
           'interest_id_B' => MAILCHIMP_INTEREST_ID_B,
           'email' => $email,
           'status' => 'pending'
        ]);
    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',			
    	    'interests' => array(
    		$options['interest_id_A'] => true,
    		$options['interest_id_B'] => 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);
        }
    Notes: Groups in Mailchimp dev talk are 'interests'. Finding the appropriate id of an interest (to add to the language file) is not straightforward. These days the only way to find these out is via an API call. Add the following code to a new php file in the root directory of your website and run it in a browser e.g. mywebsite[dot]com/mynewfile.php. The code is on this page, but I'll include it here in case it disappears.
    Code:
    <?php
    $api_key = 'xxxxxxxxxxxxxxxxxxx-us13'; // your api key
    $server = 'us13.'; // your server
    
    $list_id = 'xxxxxxxxxxxxx'; // your list id
    $group_id = 'xxxxxxxxxxxx'; // your group id
    
    $auth = base64_encode( 'user:'.$api_key );
    	
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://'.$server.'api.mailchimp.com/3.0/lists/'.$list_id.'/interest-categories/'.$group_id.'/interests');
    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->interests as $obj) {
    	echo $obj->id . ' - ' . $obj->name;
    	echo '<br />';
    }
    
    echo '<pre>'; print_r($result_obj); echo '</pre>';
    ?>
    Attached Images Attached Images  
    Last edited by simon1066; 9 Jan 2022 at 04:44 PM.
    Simon

  8. #388
    Join Date
    Aug 2005
    Location
    San Juan, Puerto Rico
    Posts
    1,485
    Plugin Contributions
    9

    Default Re: MailChimp Newsletter Sidebox

    I believe <<<This is of course MY opinion>>> that updating and developing the MooSend module is the way to go. They already have a module to sync with ZC and do some automations (like abandoned cart or getting into a list). Their service is cheaper and you can create different lists (groups like you call them) for your newsletters, without paying extra. Much more of a selection of templates and some free features that Mailchimp doesn't offer on their free tier.

    The only feature that Mailchip offers for free that MooSend doesn't is the "post on social media" after a newsletter is sent.
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!
    My contributions: SophyBlue / Sophy Blue-Grey / Mistik / The Bookshelf / Dynamic Sideboxes

  9. #389
    Join Date
    Feb 2009
    Location
    UK
    Posts
    945
    Plugin Contributions
    0

    Default Re: MailChimp Newsletter Sidebox

    Quote Originally Posted by ideasgirl View Post
    I believe <<<This is of course MY opinion>>> that updating and developing the MooSend module is the way to go. They already have a module to sync with ZC and do some automations (like abandoned cart or getting into a list). Their service is cheaper and you can create different lists (groups like you call them) for your newsletters, without paying extra. Much more of a selection of templates and some free features that Mailchimp doesn't offer on their free tier.

    The only feature that Mailchip offers for free that MooSend doesn't is the "post on social media" after a newsletter is sent.
    Thanks for this, that's interesting. I'll take a look.
    Simon

  10. #390
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    8,229
    Plugin Contributions
    111

    Default Re: MailChimp Newsletter Sidebox

    @ideasgirl 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. In the specific case of MooSend though, please coordinate with them, since they did the integration for us.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 
Page 39 of 40 FirstFirst ... 2937383940 LastLast

Similar Threads

  1. v150 Newsletter Sidebox & Newsletter signup
    By meljen in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 28 Nov 2012, 09:44 PM
  2. Login page->Newsletter->Mailchimp
    By Happyworker in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 23 Jun 2010, 10:41 PM
  3. Anyone know how to add field for Mailchimp to sidebox?
    By daneh in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 16 Sep 2009, 04:40 PM
  4. Adding a user to a MailChimp newsletter?
    By fabiola-and-singsing in forum General Questions
    Replies: 3
    Last Post: 16 Feb 2009, 10:07 AM
  5. Stop Sidebox header from linking - MailChimp
    By Mickmo68 in forum Addon Sideboxes
    Replies: 2
    Last Post: 21 Nov 2008, 05:54 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR