This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » News & Announcement

[HOWTO] Integrate your form with MailChimp


  1. yuniar

    This is pretty advanced functionality:
    http://www.appnitro.com/blog-mailchimp-integration

    If you have any questions or need help, please feel free to post here.


    MachForm Founder

    Posted 9 years ago #
  2. octochops
    Member

    Hi Yuniar,

    Thank you for the blog post. However is there anyway to tie this into a conditional checkbox field? This way you can add the functionality in addition to other forms. Generally on other forms you want to give someone the ability to sign up for a newsletter or not. Ideally it would be great if a checkbox is checked (Sign up for the newsletter?) then the web hook is triggered and the user gets registered, as opposed to everyone getting registered.

    Posted 9 years ago #
  3. yuniar

    At this moment it won't be possible to apply any logic with the webhook yet. Sorry.


    MachForm Founder

    Posted 9 years ago #
  4. chavi
    Member

    Hi Yuniar,
    I followed the instructions in the blog post as outlined above.
    At first, I was able to see the failed attempts of the api calls through mailchimp (error was that not all the required merge fields were linked)
    Once I corrected the error I was getting - I dont see any api calls listed at all - no success or failure responses.
    Is there any way to troubleshot & see what the problem is?
    Thanks

    Posted 9 years ago #
  5. chavi
    Member

    I discovered the problem - I had first & last names as required fields.
    as soon as I disabled them, the subscriptions work - but they only add the email address.
    Is there a way to get the first & last name (& other) fields from machforms to merge into mailchimp?

    Posted 9 years ago #
  6. yuniar

    You can send any of your field data to MailChimp. Just make sure to use the correct template variables and the correct parameter name as required by MailChimp API


    MachForm Founder

    Posted 9 years ago #
  7. philiptsang
    Member

    Using your MailChimp API tutorial, I was able to add emails to my MailChimp list. I was trying to also figure out how to add the the first and last name to the MailChimp list from Machforms, but I couldn't get it working. Can you advise? Thank you!

    Posted 9 years ago #
  8. yuniar

    You can add the merge tags below your email code, it should be something like this:

    "merge_vars": {
       "MERGE1": "{element_1_1}",
       "MERGE2": "{element_1_2}"
    },

    or

    "merge_vars": {
       "fname": "{element_1_1}",
       "lname": "{element_1_2}"
    },

    the last one above assuming your merge tags are "fname" and "lname"

    To find your merge tags, you can check this link:
    http://kb.mailchimp.com/article/getting-started-with-merge-tags


    MachForm Founder

    Posted 9 years ago #
  9. Christine
    Member

    I have figured out the integration, but now I'm curious how to fix the error that comes up if an email address is already subscribed to the list. Here is the error that came up when I entered my email twice (I've removed my email here).

    Error Sending Webhooks! Internal Server Error.string(177) "{"status":"error","code":214,"name":"List_AlreadySubscribed","error":"info@-----.com is already subscribed to list Test. Click here to update your profile."}"

    Posted 9 years ago #
  10. yuniar

    This one is a bit problematic. The error message you described above is perfectly valid. By default MachForm will simply display the error message returned by MailChimp.

    If you want to hide the error message, you can edit your "includes/helper-functions.php" file, search around line 366 for this block of code:

    if(!in_array($webhook_status,$http_success_codes)){
    			echo "Error Sending Webhooks! ";
    			switch ($webhook_status) {
    				case '404':
    					echo "Website URL Not Found ({$webhook_url})";
    					break;
    				case '401':
    					echo "Unauthorized Access. Incorrect HTTP Username/Password for Website URL.";
    					break;
    				case '403':
    					echo "Forbidden. You don't have permission to access the Website URL.";
    					break;
    				case '302':
    					echo "Page Moved Temporarily.";
    					break;
    				case '307':
    					echo "Page Moved Permanently.";
    					break;
    				case '500':
    					echo "Internal Server Error.";
    					break;
    				default:
    					echo "Error Code: ({$webhook_status})";
    					break;
    			}
    			var_dump($webhook_client->getContent());
    		}

    remove the entire block of code above.


    MachForm Founder

    Posted 9 years ago #
  11. Giorgio
    Member

    Hi,
    Could I use mailchimp just for sending the notification email each time that a form is submitted? I'm asking because my hosting provider is limiting the number of emails I can send per day... or would you suggest another solution to bypass the limited number of emails? Thanks for your help

    Posted 9 years ago #
  12. rgraby
    Member

    Hi, I am having problems with my mail chimp integration. Here is the error I am getting:

    Error Sending Webhooks! Internal Server Error.string(97) "{"status":"error","code":-100,"name":"ValidationError","error":"You must specify a apikey value"}"
    Warning: Cannot modify header information - headers already sent by (output started at /home/content/52/3909552/html/straightedgepower/app/includes/helper-functions.php:369) in /home/content/52/3909552/html/straightedgepower/app/confirm_embed.php on line 47

    I have double checked my api key and my list id but for some reason it is not working.

    Here is my configuration:

    Custom Headers:
    {
    "Content-Type": "application/json",
    "User-Agent": "MachForm Webhook v4.0"
    }

    Raw Data: (I have hidden the key and id)
    {
    "apikey": "xxxxxxxxxxxxxxxxxx",
    "id": "xxxxxxxxxxx",

    "email": {
    "email": "{element_2}"
    "MMERGE4": "{date_created}"
    "MMERGE3": "{entry_no}"
    "FNAME": "{element_4_1}"
    "LNAME": "{element_4_2}"
    "MMERGE5": "{element_5}"
    "MMERGE6": "{element_7_1}"
    "MMERGE7": "{element_7_3}"
    "MMERGE8": "{element_7_4}"
    "MMERGE9": "{element_7_5}"
    "MMERGE10": "{element_27}"

    },
    "double_optin": false,
    "update_existing": true,
    "replace_interests": true,
    "send_welcome": false
    }

    Posted 8 years ago #
  13. robertosantos
    Member

    I'm having the same problem as described by rgraby.

    Error Sending Webhooks! Internal Server Error.string(97) "{"status":"error","code":-100,"name":"ValidationError","error":"You must specify a apikey value"}"

    Posted 8 years ago #
  14. yuniar

    Can you guys contact us directly and let us know the login to your MachForm please.
    We'll check it directly.

    http://www.appnitro.com/contact


    MachForm Founder

    Posted 8 years ago #

RSS feed for this topic

Reply