Skip to content

Instantly share code, notes, and snippets.

@juanjdlt
juanjdlt / php_mailchimp.php
Created July 13, 2015 23:48
Mailchimp API v3: Save member to a specific list in PHP
<?php
/* RESOURCES
* API Overview: http://kb.mailchimp.com/api/article/api-3-overview
* Endpoint doc: http://kb.mailchimp.com/api/resources/lists/members/lists-members-collection
* I highly recommend to check out the API Playground and check the available params and how to create the call depending on you need:
* http://kb.mailchimp.com/api/article/about-the-playground
*/
$mc_api_key = MAILCHIMP_API_KEY;
$mailchimp_url_endpoint = 'https://us3.api.mailchimp.com/3.0/lists/547a212260/members';
$current_date_time = new DateTime("now", new DateTimeZone('America/Mexico_City'));
@juanjdlt
juanjdlt / custom_html_form.html
Created June 12, 2015 23:10
Plugin that saves a lead from OptinMonster to HubSpot CRM (directly)
<form role="form" method="POST" action="/" onsubmit="return false;" class="optin-tk-forms">
<input placeholder="Fullname" id="nombre" name="name" type="text" />
<input placeholder="Email" id="email" name="email" type="text" />
<input autcomplete="off" placeholder="ej. @twitter" name="twitter" type="text" class="optinMonster-twitter"/>
<!-- [name=twitter] imput field should be set to display:none or any other technique that makes that imput dissapear (HoneyPot Technique) -->
<input type="radio" name="contact_type" value="recruiter" checked/>are you recruiter? &nbsp; <input type="radio" name="contact_type" value="candidate"/> Are you candidateo?<br/>
<input type="submit" value="Enviar" />
</form>