<![CDATA[ MailChimp and MODx? - My Forums]]> https://forums.modx.com/thread/?thread=18409 <![CDATA[Re: MailChimp and MODx?]]> https://forums.modx.com/thread/18409/mailchimp-and-modx?page=6#dis-post-442034
This post as base: http://forums.modx.com/thread/18409/mailchimp-and-modx?page=5#dis-post-101076

Downloaded the package.
Uploaded it into the snippets map.
Changed a line (20 +/-) into subscribe.snippet.php (api instead of password, username)
Updated the MCAPI.class.php downloaded from mailchimp (1.3)
Changed the config file to the api, see post
Added the form mcSubscribeForm:

<p>[[+MailChimp.message]]</p>
<form method="post" action="[~[*id*]~]">
    <label>First Name: <input type="text" name="mc_FNAME" value="" /></label>
    <label>Last Name: <input type="text" name="mc_LNAME" value="" /></label>
    <label>Email: <input type="text" name="mc_EMAIL" value="" /></label>
    <input type="submit" name="subscribe" value="Subscribe" />
</form>


The call:
[ ! mailchimpSubscribe?form=`mcSubscribeForm` &listId=`xxxx32edb` ! ]


I see the form but after submitting, nothing happens sad

Anyone got this working lately?



#EDIT#

When I paste the embedded code from mailchimp it opens into a new page, got email, and need to accept, but its not on my website..
Maybe someone can figer it out what to do, I'm done with it at the moment pfff.



< link href="http://cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
< style type="text/css">#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }</style>

< div id="mc_embed_signup">
< form action="http://websiteurlhere.us6.list-manage1.com/subscribe/post?u=320fd49a9019b27cexxxxx8b3&id=xxxx32edb" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
	<label for="mce-EMAIL">Subscribe to our mailing list</label>
	< input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
	<div class="clear">< input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
< /form>
</div>


]]>
fourroses666 Nov 01, 2012, 11:16 AM https://forums.modx.com/thread/18409/mailchimp-and-modx?page=6#dis-post-442034
<![CDATA[Re: MailChimp and MODx?]]> https://forums.modx.com/thread/18409/mailchimp-and-modx?page=6#dis-post-412488
I've tried the snippet with evo 1.0.5 but I get a parse error. I did the setup as mentioned on marys codinpad. this is the error message. However the file is right at this place.

 Error:	require_once(/Users/beatbeer/Sites/tvg/assets/snippets/mailchimp/classes/MCAPI.class.php) [function.require-once]: failed to open stream: No such file or directory	 
  Error type/ Nr.:	Warning - 2	 
  File:	/Users/beatbeer/Sites/tvg/manager/includes/document.parser.class.inc.php(814) : eval()'d code	 
  Line:	16


your help is much appreciated]]>
bbeer Feb 18, 2012, 04:16 AM https://forums.modx.com/thread/18409/mailchimp-and-modx?page=6#dis-post-412488
<![CDATA[Re: MailChimp and MODx?]]> https://forums.modx.com/thread/18409/mailchimp-and-modx?page=6#dis-post-396053 cristianb88 Oct 06, 2011, 02:59 AM https://forums.modx.com/thread/18409/mailchimp-and-modx?page=6#dis-post-396053 <![CDATA[Re: MailChimp and MODx?]]> https://forums.modx.com/thread/18409/mailchimp-and-modx?page=6#dis-post-101086
I cant get it working in Evo 1.0.5
I Get Those errors

MODx encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed - Incorrect string value: ’\xA0’ for column ’moduleguid’ at row 1 »
SQL: INSERT INTO `newsletter`.`modx_site_snippets` (name, description, snippet, moduleguid, locked, properties, category) VALUES(’mailchimpSubscribe’, ’’, ’\r\ngetChunk($form) != null) {\r\n if (isset($_POST[\’subscribe\’])) {\r\n require_once MODX_BASE_PATH.\’assets/snippets/mailchimp/classes/MCAPI.class.php\’;\r\n require_once MODX_BASE_PATH.\’assets/snippets/mailchimp/includes/config.inc.php\’;\r\n \r\n // Connect to the MailChimp server with the user\’s credentials.\r\n $api = new MCAPI($username, $password);\r\n if ($api->errorCode!=\’\’) {\r\n if ($debug == true) {\r\n $debugOutput .= \"code:\".$api->errorCode.\"\\n\";\r\n $debugOutput .= \"msg :\".$api->errorMessage.\"\\n\";\r\n return $modx->getChunk($form);\r\n } else {\r\n $modx->setPlaceholder(\’MailChimp.message\’, \’Login to remote service failed\’);\r\n return $modx->parseChunk($form, $modx->placeholders, \’[+\’,\’+]\’);\r\n }\r\n }\r\n \r\n $mergeVars = array();\r\n foreach($_POST as $key => $value) {\r\n if(substr($key,0,3) == \’mc_\’) {\r\n $fieldName = ltrim($key, \’mc_\’);\r\n $mergeVars[$fieldName] = $value;\r\n }\r\n }\r\n \r\n if(empty($mergeVars)) {\r\n $mergeVars = array(\’\’);\r\n }\r\n \r\n $retVal = $api->listSubscribe($listId, $_POST[\’mc_EMAIL\’], $mergeVars);\r\n \r\n if (!$retVal) {\r\n if ($debug == true) {\r\n $debugOutput .= \"Unable to load listSubscribe()!\\n\";\r\n $debugOutput .= \"\\tCode=\".$api->errorCode.\"\\n\";\r\n $debugOutput .= \"\\tMsg=\".$api->errorMessage.\"\\n\";\r\n }\r\n $modx->setPlaceholder(\’MailChimp.message\’, \’There was a problem subscribing you.\’);\r\n } else {\r\n if ($debug == true) {\r\n $debugOutput .= \"Returned: \".$retVal.\"\\n\";\r\n }\r\n $modx->setPlaceholder(\’MailChimp.message\’, \’You were successfully subscribed\’);\r\n }\r\n }\r\n if ($debug == true) echo $debugOutput;\r\n if (is_array($modx->placeholders)) {\r\n $ph = array_merge($modx->config, $modx->placeholders);\r\n } else {\r\n $ph = $modx->config;\r\n }\r\n return $modx->parseChunk($form, $ph, \’[+\’,\’+]\’);\r\n} else {\r\n return \’Please specify a valid form.\’;\r\n}\r\n?>\r\n’, ’ ’, ’0’,’’, ’0’);
[Copy SQL to ClipBoard]

Parser timing
MySQL: 0.0020 s (1 Requests)
PHP: 1306836988.9091 s
Total: 1306836988.9111 s]]>
Mtarnuhal May 31, 2011, 05:20 AM https://forums.modx.com/thread/18409/mailchimp-and-modx?page=6#dis-post-101086
<![CDATA[Re: MailChimp and MODx?]]> https://forums.modx.com/thread/18409/mailchimp-and-modx?page=6#dis-post-101085
Here’s a tip. Calling it from webloginPE case register using the modx runSnippet method from within the (slightly modified) webloginPE snippet works just peachy as wel.
Saved me a load of work when integrating a newsletter signup tickbox into an existing register form.

]]>
Towila May 18, 2011, 08:38 AM https://forums.modx.com/thread/18409/mailchimp-and-modx?page=6#dis-post-101085
<![CDATA[Re: MailChimp and MODx?]]> https://forums.modx.com/thread/18409/mailchimp-and-modx?page=6#dis-post-101084 Quote from: ecreate at Dec 01, 2010, 05:47 PM

That’s it. I’m going to work on an lightweight AJAX version using Jquery shortly.

Has there been any further progress on this?

and +1 for adding to the repo!]]>
jaredloman May 11, 2011, 01:34 AM https://forums.modx.com/thread/18409/mailchimp-and-modx?page=6#dis-post-101084
<![CDATA[Re: MailChimp and MODx?]]> https://forums.modx.com/thread/18409/mailchimp-and-modx?page=6#dis-post-101083
Thanks for your time!]]>
fastmule Apr 16, 2011, 12:51 PM https://forums.modx.com/thread/18409/mailchimp-and-modx?page=6#dis-post-101083
<![CDATA[Re: MailChimp and MODx?]]> https://forums.modx.com/thread/18409/mailchimp-and-modx?page=5#dis-post-101082 rethrash Mar 20, 2011, 08:19 PM https://forums.modx.com/thread/18409/mailchimp-and-modx?page=5#dis-post-101082 <![CDATA[Modx Revolution Mailchimp Integration]]> https://forums.modx.com/thread/18409/mailchimp-and-modx?page=5#dis-post-101081 Quote from: ecreate at Dec 01, 2010, 05:47 PM

I managed to get this working in Revolution. I’ve removed the need for the username&password and now only require an API key. So, starting from Garry’s snippet, do the following:

EDIT: Forgot to mention you need to update the API to 1.3 - I just added this at point 2.

1) Find your Mailchimp API key in Mailchimp by going to Account (very top left) -> API Keys & Info (bottom). The key will look something like 45g7453redf3b26r019d230a543e84fg-us2

2) Download the latest Mailchimp PHP API (as of this post, 1.3) - http://www.mailchimp.com/api/downloads/#php. Replace the API in classes/MCAPI.class.php with the one you just downloaded.

3) Erase everything in config.inc.php and replace with:
<?php
$apikey = 'YOUR MAILCHIMP APIKEY';


4) In the snippet code (subscribe.snippet.php), go to line 20 and replace
$api = new MCAPI($username, $password);

with
$api = new MCAPI($apikey);


5) Replace the chunk (subscribe.form.tpl), with the following. It changes the evo tags to revo and swaps mc_FIRST/mc_LAST with mc_FNAME and mc_LNAME (what MC will expect):
<p>[[+MailChimp.message]]</p>
<form method="post" action="[[~[[*id]]]]">
	<label>First Name: <input type="text" name="mc_FNAME" value="" /></label><br />
	<label>Last Name: <input type="text" name="mc_LNAME" value="" /></label><br />
	<label>Email: <input type="text" name="mc_EMAIL" value="" /></label>
	<input type="submit" name="subscribe" value="Subscribe" />
</form>


5) Snippet call becomes: (evo->revo)
[[!mailchimpSubscribe?form=`mailchimpForm` &listId=`<YOUR LIST ID>`]]


That’s it. I’m going to work on an lightweight AJAX version using Jquery shortly.

I have made the changes and updated the zip (which is attached) for those who can’t be bothered to update the code tongue

Well done eCreate!!! Great Contribution!]]>
dannycheeseman Mar 12, 2011, 03:06 AM https://forums.modx.com/thread/18409/mailchimp-and-modx?page=5#dis-post-101081
<![CDATA[Re: MailChimp and MODx?]]> https://forums.modx.com/thread/18409/mailchimp-and-modx?page=5#dis-post-101080
http://wordpress.org/extend/plugins/autochimp/


And the Mailchimp webhooks reference. http://apidocs.mailchimp.com/webhooks/]]>
jbjones Mar 11, 2011, 11:18 PM https://forums.modx.com/thread/18409/mailchimp-and-modx?page=5#dis-post-101080