The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Integrating A MailChimp Newsletter Option - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17) +--- Thread: Integrating A MailChimp Newsletter Option (/showthread.php?tid=2414) |
Integrating A MailChimp Newsletter Option - michatmaster7 - Apr 5th, 2013 . . Instructions for Integrated MailChimp Newsletter Signup to a FormTools Form
Note: This set of instructions does not use MailChimps double opt-in option. With a little research using the links provided at the end, I'm confident that someone will be able to implement that as an additional feature and post a reply here. 2013-08-22 UPDATE: I am still using Mail Chimp API v1.3.2 for this post. UPDATE: Added "OPTIN_TIME" code. Added resource to bottom. UPDATE: Added step 3a (to verify merge tags). 1) Download the proper API Wrapper for MailChimp. For PHP forms, scroll to the PHP scetion of the following link and download MCAPI v{current}. Make sure you are using the most up-to-date version. I suggest putting this in a well-organized folder structure, so you'll understand what it is when you look at it next year. (ie: Design Work\FormTools\MailChimp API Addition\MailChimp API Wrappers\MCAPI v1.3.2 (PHP)\PHP wrapper full\{extracted files}) MailChimp API Wrappers: http://apidocs.mailchimp.com/api/downloads/#php 2) Upload the MailChimp API to your web site. In your web site structure, add a new directory inside the FormTools directory, called /mailchimp/. Upload the MCAPI.class.php file from Step 1 to this new directory. (ie: path/to/formtools/mailchimp/MCAPI.class.php) 3) Add the MailChimp API code to your form. I'm going to assume that you're using server-side (PHP) validation on your external form and that you already have a working form, so look for the following IF statement in your forms PHP: PHP Code: <?php Now you're going to add the following chunk of code just above the line with "$params = array(" Note: make sure you read all the comments in this code. Update fields to match your own form field name attributes. The following is just an example. PHP Code: <?php You're end result should look something like this: PHP Code: <?php 3a) Verify your merge tags are correct in MailChimp Login to your Mailchimp account and view the list you want to use for this form. Select the Settings Menu and choose "List fields and *|MERGE|* tags". Verify that the tags are equal to your PHP code. (Eg: The "First Name" field label should have FNAME as the merge tag, if FNAME is in the PHP code). 4) Add your unique MailChimp API Key and List ID. All that's left is to put in your own unique API key and List ID. Here are the instructions for finding those keys in your own MailChimp account: Where can I find my API Key?: http://kb.mailchimp.com/article/where-can-i-find-my-api-key How can I find my List ID?: http://kb.mailchimp.com/article/how-can-i-find-my-list-id Keeping your API key secure.: http://kb.mailchimp.com/article/keeping-your-api-key-secure 5) Test the new MailChimp integration. You can test this out by submitting the live form with the proper input for "signing up" and then checking your MailChimp subscriber list to make sure you were added. If possible, I recommend using the double opt-in feature. It's just not something I coded, because it wasn't requested of my client at the time. Resources: - Add a Subscribe to MailChimp Newsletter Option on Your Contact Form in 5 Minutes: http://www.joshuawinn.com/subscribe-to-mailchimp-newsletter-option-on-contact-form/ - Official Example Code for MailChimp API v1.3 - listSubscribe() method: http://apidocs.mailchimp.com/api/1.3/listsubscribe.func.php - Example code for OPTIN_TIME provided by adamdehaven's answer: http://stackoverflow.com/questions/15772763/one-list-two-different-thank-you-pages-with-mailchimp RE: Integrating A MailChimp Newsletter Option - Joe - Apr 5th, 2013 Brandon, This is awesome!! Thanks so much for posting this. We have numerous request from users on how to integrate with list management systems like MailChimp. I'm sure they will find this very helpful. Cheers, Joe RE: Integrating A MailChimp Newsletter Option - michatmaster7 - Aug 22nd, 2013 I added some stuff today (see Updates at top). I will probably need to either create a duplicate thread or update this one in the coming months as Mailchimp is now using an entirely new API (2.0.2). Hopefully they don't EOL the 1.3.2 API anytime soon, because I really don't have time to re-learn everything (especially since I don't speak PHP very well). Example: it took me ALL DAY to research, test and implement these changes for my own forms. Mostly because I'm not very good with PHP. RE: Integrating A MailChimp Newsletter Option - Joe - Aug 24th, 2013 Awesome! Thanks so much for sharing! Cheers, Joe RE: Integrating A MailChimp Newsletter Option - Makayla Lardner - May 28th, 2020 To sending email in bulk you must need the best tool which name is mail champ and it gives the free bulk email to send in one time. So you must check the essaygeeks review so that it will mike you more happy and active. RE: Integrating A MailChimp Newsletter Option - Jacob Picton - Aug 17th, 2020 Whenever you try to open new site or forum, you have to fill up the form that is the basic requirement. Although I suggest that vape shops in lahore will guide you according to your needs and demands as well. RE: Integrating A MailChimp Newsletter Option - Macejkovic - Dec 17th, 2020 Tony alien is implied for the struggle and all tips for the factors. All the joys of the tony and Nals certification medical in the simple methods for the guys. The base is counted for the approval of the target for the terms and themes. |