Forums / Addon Sideboxes / MailChimp Newsletter Sidebox

MailChimp Newsletter Sidebox

Views: 189,702

Results 181 to 200 of 403
5 Feb 2013, 3:28 AM
#181
mikecnz avatar

mikecnz

New Zenner

Join Date:
Mar 2009
Location:
New Zealand
Posts:
76
Plugin Contributions:
0

MailChimp Newsletter Sidebox

robraymond:

I figured it out.
/includes/modules/your-template/create_account

mailchimp_add($email_address, $email_format);

> becomes
> ```
mailchimp_add($email_address, $firstname, $lastname, $company, $email_format);

includes/functions/extra_functions/mailchimp_functions.php

function mailchimp_add($email_address, $email_format) {
include_once(DIR_WS_CLASSES . "MCAPI.class.php");
$api = new MCAPI(BOX_MAILCHIMP_NEWSLETTER_API_KEY);
$merge_vars = array('');

> becomes
> ```
 function mailchimp_add($email_address, $firstname, $lastname, $company, $email_format) {
    include_once(DIR_WS_CLASSES . "MCAPI.class.php");
    $api = new MCAPI(BOX_MAILCHIMP_NEWSLETTER_API_KEY);
    $merge_vars = array('FNAME'=>$firstname, 'LNAME'=>$lastname, 'COMPANY'=>$company);

Hopefully this is the right way to do this.

Hi,

Thanks for that - I am trying to get this work for fast and easy check out.

I've done everything else as you've stated except I changed the code in /includes/modules/fec_create_account

But for whatever reason it doesn't want to work - any ideas?

7 Feb 2013, 1:10 AM
#182
mikecnz avatar

mikecnz

New Zenner

Join Date:
Mar 2009
Location:
New Zealand
Posts:
76
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

Hi,

I got this to work with FEC,

simply add the code

 if ((int)$newsletter == 1) { 
   mailchimp_add($email_address, $firstname, $lastname, $email_format);

}

to /includes/modules/fec_create_account instead of /includes/modules/your-template/create_account and follow the instructions above for includes/functions/extra_functions/mailchimp_functions.php. I made a typo in mailchimp_functions.php hence the reason for my e-mail above - but once I fixed it, everything worked as it should.

23 Apr 2013, 12:41 PM
#183
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,724
Plugin Contributions:
56

Re: MailChimp Newsletter Sidebox

The MailChimp guys fiddle constantly with the anchor tags and layout of their website, but I do my best to keep the instructions on my home page current. I just did a new install and noticed that the current README descriptions don't correlate precisely to the links and positions on the MailChimp page, but the instructions on the help page on my site have been updated. Go there if you're having trouble figuring out what to do.

That Software Guy. My Store: Zen Cart Support
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.

28 Apr 2013, 6:44 PM
#184
lsullivan avatar

lsullivan

New Zenner

Join Date:
May 2010
Posts:
57
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

Hi SWguy,
The sidebox function works great. I kept only the email address in the form, and then when the user clicks submit they are directed to the full sign up page to add additional information. I am having no issues with side box email list adds. My website is https://www.SETboutique.com.

My issues are with create account functions:
I followed step 5 in the installation instructions, but when I created a test account I didn't receive any emails from mailchimp.

I then followed the advice from a previous post and edited /includes/modules/custom_template/create_account.php to the following:
//--- added mailchimp
if ((int)$newsletter == 1) {
mailchimp_add($email_address, $firstname, $lastname, $email_format);
}
//--- End mailchimp

I created a new test account but I still didn't receive any emails from mailchimp.
I then took additional advice from a previous post and edited /includes/functions/extra_functions/mailchimp_functions.php to the following:
function mailchimp_add($email_address, $fname, $lname,$email_format) {

I created a new test account but I still didn't receive any emails from mailchimp.

Could you offer any additional advice? I am using ZC1.5.1, and mailchimp3.0. I added a new API for the use of this mod. I already had an API in mailchimp but I added a new one for this coding (just a FYI in case it helps).

Thank you,
Lindsay

28 Apr 2013, 6:48 PM
#185
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,724
Plugin Contributions:
56

Re: MailChimp Newsletter Sidebox

I'd suggest you install the software I wrote and get that working prior to making any changes. This includes the API version I packaged up.

That Software Guy. My Store: Zen Cart Support
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.

8 May 2013, 6:49 AM
#186
lsullivan avatar

lsullivan

New Zenner

Join Date:
May 2010
Posts:
57
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

Hi,
I made the changes only because I couldn't get the original to work as stated before. I can remove the changes if you don't agree with them. But can you offer any advice for the create account functioning?

Thank you,
Lindsay

17 May 2013, 5:03 PM
#187
maartenj avatar

maartenj

New Zenner

Join Date:
Apr 2013
Location:
Netherlands
Posts:
12
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

Very nice module! Works great on ZC 1.5.1. I've made some slight changes to the coding. If your country doesn't obligate you to use a double opt-in procedure you can use the ```php
$double_optin = false


I've found it very annoying for the customers to get two e-mails when they sign up at your store and place a checkmark that they want to receive a e-mail newsletter already. 

For those that aren't that skilled in programming:
This line of code:
```php
$retval = $api->listSubscribe($list_id, $email_address, $merge_vars, $format);

Becomes

$retval = $api->listSubscribe($list_id, $email_address, $merge_vars, $format, $double_optin = false);

Some minor improvement would be to make mailchimp update your list when someone changes their info on their 'My Account' page, I will code something for that tonight:-)

17 May 2013, 7:47 PM
#188
maartenj avatar

maartenj

New Zenner

Join Date:
Apr 2013
Location:
Netherlands
Posts:
12
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

Allright, coded the update function after my diner. When a customer updates his or her information on the "my account" page, this change will be synced with your Mail Chimp list. Here's how I dit it:

In mailchimp_functions.php from this great module I added my own function at the end of the file. Note that I added a field for Firstname and Lastname. You can do that, but if you don't want to just delete everything with firstname and lastname in it:

//Mailchimp update function: update customers data to the mailchimp list.
 function mailchimp_update($email_address_old, $email_address, $firstname, $lastname, $email_format) {
    include_once(DIR_WS_CLASSES . "MCAPI.class.php");
    $api = new MCAPI(BOX_MAILCHIMP_NEWSLETTER_API_KEY);
	$merge_vars = array('FNAME'=>$firstname, 'LNAME'=>$lastname, 'EMAIL'=>$email_address);
    if ($email_format == 'TEXT') {
       $format = 'text'; 
    } else {
       $format = 'html'; 
    }

    $list_id = BOX_MAILCHIMP_NEWSLETTER_ID; 
    $retval = $api->listUpdateMember($list_id, $email_address_old, $merge_vars, $format);
    if ($api->errorCode){
        $errorMessage = "Unable to update member info with listUpdateMember()!\n" . 
           "\tCode=".$api->errorCode."\n" .
           "\tMsg=".$api->errorMessage."\n";
          $file = DIR_FS_SQL_CACHE . '/' . 'MailChimp.log';
          if ($fp = @fopen($file, 'a')) {
            fwrite($fp, $errorMessage);
            fclose($fp);
          }
    }
 }

In htdocs/includes/templates/YOURTEMPLATE/templates/tpl_account_edit_default.php you must make an invisible field to be able to pass the old email address (email_address_old) to the mailchimp_update() function. I've placed this line below the entry for the e-mail address, but you can paste in anywhere as long as it is within the form:

<?php echo zen_draw_hidden_field('email_address_old', $account->fields['customers_email_address'], 'id="email-address-old"') ?>

At last you must make a call to the function. When the form is submitted it will use /includes/modules/pages/account_edit/header_php.php to make all the magic happen. Paste the following around line 154 above the line:
$zco_notifier->notify('NOTIFY_HEADER_ACCOUNT_EDIT_UPDATES_COMPLETE');

mailchimp_update($email_address_old, $email_address, $firstname, $lastname, $email_format);

That's all! Now your mailchimp list will be updated as soon as your customer edits his or her information! Next thing to do is to make a sync for the "Subscribe or unsubscribe from newsletters." page.

17 May 2013, 9:19 PM
#189
maartenj avatar

maartenj

New Zenner

Join Date:
Apr 2013
Location:
Netherlands
Posts:
12
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

**Note: Only usefull if you've included additional info in your mailchimp list such as first name, last name, country etc.
**
I've made a really small improvement.

I noticed that when a non-customer signs up for the maillinglist with the sidebox module the customer is added to the mailchimp list as supposed to. But when that non-costumer is going to be your customer, the API doesn't update the name field and lastname field (this is only if you've made some changes yourself to the original code to include additional customer information). With a really small change you can let the mailchimp API update the information as soon as the non-costumer becomes a customer.

In mailchimp_functions.php add php $update_existing = true so that the line becomes (in my case) ```php
$retval = $api->listSubscribe($list_id, $email_address, $merge_vars, $format, $double_optin = false, $update_existing = true);


When a newsletter only person signs up for a new account, all the info will be automatically updated to mailchimp!
9 Jun 2013, 9:43 PM
#190
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

swguy:

I'd suggest you install the software I wrote and get that working prior to making any changes. This includes the API version I packaged up.

Hi, thanks for the great mod. I'm having the same trouble in the create account process. The account is created there is no confirmation email from mailchimp as expected. I would appreciate any advice. Thank you!

10 Jun 2013, 1:15 PM
#191
joyjoy avatar

joyjoy

Totally Zenned

Join Date:
Sep 2010
Posts:
611
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

joyjoy:

Hi, thanks for the great mod. I'm having the same trouble in the create account process. The account is created there is no confirmation email from mailchimp as expected. I would appreciate any advice. Thank you!

I reinstalled, it's okay now. But I have another questions. Is there a way to have the confirmation screen display as a popup window? Thank you.

19 Jul 2013, 6:32 AM
#192
crexis avatar

crexis

New Zenner

Join Date:
Jul 2013
Posts:
31
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

Let me preface by saying I'm a newbie.

I'm trying to install mailchimp and am following the readme and the instructions aren't completely clear.

In the readme it states:

At the bottom of the form will be something like this:

<td align="left"><INPUT TYPE='submit' NAME='submit' VALUE='Subscribe'> <input type="hidden" name="id" value="5331068383"> <input type="hidden" name="u" value="0dcb1c9808"></td>

Note the the values of "u" and "id" - you will be
embedding them in the language file during the installation process

In the html, the only thing I found with 'input type', which was near the top was this:

</label> <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL"> </div> <div id="mce-responses" class="clear"> <div class="response" id="mce-error-response" style="display:none"></div> <div class="response" id="mce-success-response" style="display:none"></div> </div> <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div> </form>

The parts "u" and "id" I need to take a note of, there is no "u" and the id ="mce-success-response"

Then it states:

  1. Edit the file
    includes/languages/english/extra_definitions/mailchimp_sidebox_defines.php
    set the BOX_MAILCHIMP_NEWSLETTER_ID to the "id" value you noted
    in step 3 of the pre-installation instructions.
    set the BOX_MAILCHIMP_NEWSLETTER_U to the "u" value you noted
    in step 3 of the pre-installation instructions.

Is that the right "id" value and what is the "u" value?

Any help greatly appreciated!

19 Jul 2013, 12:40 PM
#193
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

You'll find the id and u values in your Mail Chimp sign-up form. You won't actually use the sign-up form, at least not for this plugin, but that is where you'll find your id and u values.

Jim
Wheaton Website Services

19 Jul 2013, 7:42 PM
#194
crexis avatar

crexis

New Zenner

Join Date:
Jul 2013
Posts:
31
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

That was the html I posted from the signup form off their site. Didn't have any "u" values.

19 Jul 2013, 8:15 PM
#195
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

The html you posted is not a complete sign up form. You can use the General Forms option, skip right the the Share It tab click the 'Want to embed a form on a web page?' and in the 'Copy/paste onto your site' box will be lots of html code.

The u and id values will be in a url string about ten lines down starting with <form action=

Jim
Wheaton Website Services

20 Jul 2013, 1:14 AM
#196
crexis avatar

crexis

New Zenner

Join Date:
Jul 2013
Posts:
31
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

Thanks jeking, it was under 'embedded form code' the 'copy/paste' onto your site section.

I'm having issues with these instructions:

Set BOX_MAILCHIMP_NEWSLETTER_URL to the URL value you noted in
step 3 of the pre-installation instructions

I didn't provide any url, so do I just put the site url or the url I see in the form 'code'?

thanks !

20 Jul 2013, 4:13 AM
#197
crexis avatar

crexis

New Zenner

Join Date:
Jul 2013
Posts:
31
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

https://www.sunnysihota.com/zen

I got the newsletter setup on my site! good times

However I'd like some help with some editing.

How do I get rid of the 'newsletter' title so the email suscribe and form is only showing.

I want to get rid of the 'html or text only' options, anyone know how to do that?

2 questions, hopefully someone can help, thanks in advance!

20 Jul 2013, 5:48 PM
#198
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

crexis:

Thanks jeking, it was under 'embedded form code' the 'copy/paste' onto your site section.

I'm having issues with these instructions:

Set BOX_MAILCHIMP_NEWSLETTER_URL to the URL value you noted in
step 3 of the pre-installation instructions

I didn't provide any url, so do I just put the site url or the url I see in the form 'code'?

thanks !

It's the mailchimp url from the form code.

Jim
Wheaton Website Services

20 Jul 2013, 7:29 PM
#199
crexis avatar

crexis

New Zenner

Join Date:
Jul 2013
Posts:
31
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

Ok I added this for the newsletter_url: http://sunnysihota.us7.list-manage.com/subscribe/post?

https://www.sunnysihota.com/zen

Do you know which file I would go into to remove the title "newsletter" above the form, and also changed the words to suscribe to the form/newsletter.

I want to get rid of the 'html or text' option and just auto-make it 'html', where can I change this in? I couldn't find it in the admin.

thanks for the help

11 Aug 2013, 4:21 PM
#200
adamtlhern avatar

adamtlhern

New Zenner

Join Date:
Jul 2013
Location:
United Kingdom
Posts:
9
Plugin Contributions:
0

Re: MailChimp Newsletter Sidebox

Hi All,

Is it possible yet to integrate this add-on to the customer signup process ?

Thanks