Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
mailchimp-it
Advanced tools
Readme
#Mailchimp-it
Mailchimp-it is a small Javascript Library that turn a simple form into a working mailchimp form using a small PHP script as a dependency.
My custom script use this Mailchimp PHP wrapper
to install it just
$ composer require drewm/mailchimp-api:dev-api-v3
$ composer install
If you want to use your own script, because you want to implement your own logic, or simply because you work with a language like Python ❤, just take care with the input's names, you can use the default field names, but if you wan't to use your own names, don't forget to put them in the mailchimp-it configuration.
(function () {
'use strict';
mailchimpIt('.yourForm', {
...
mailInputName: 'YOUR_CUSTOM_MAIL_FIELD_NAME',
firstNameInputName: 'YOUR_CUSTOM_FIRST_NAME_FIELD_NAME',
lastNameInputName: 'YOUR_CUSTOM_LAST_NAME_FIELD_NAME',
...
});
}());
First of all, you need to load mailchimp-it files
<!-- You can customize mailchimp-it.css -->
<link rel="stylesheet" href="dist/mailchimp-it.css"/>
<script src="dist/mailchimp-it.min.js"></script>
Then, prepare your form
<div class="form-container">
<form class="test_form" method="post" action="src/MailchimpIt.php">
<!-- Optional inputs -->
<input type="text" name="newsletter_first_name"/>
<input type="text" name="newsletter_last_name"/>
<!-- Mandatory input -->
<input type="email" name="newsletter_mail" required/>
<button type="submit">subscribe</button>
</form>
</div>
Basic usage
(function () {
'use strict';
mailchimpIt('.test_form');
}());
Mailchimp-it allow you to customize a lot of things
(function () {
'use strict';
mailchimpIt('.test_form', {
successMessage: 'Thanks for subscribing !', //Default success message
successMessageBefore: null, //innerHTML before success Message
successMessageAfter: null, //innerHTML after success Message
successMessageClassName: 'mailchimp-it-success', //Success message div class
onSuccess: function () { //Callback on Success
return;
},
errorMessageClassName: 'mailchimp-it-error', //Error message div class
errorMessageBefore: null, //innerHTML before error Message
errorMessageAfter: null, //innerHTML after error Message
errorMessageTimeout: 5000, //Time that error message will be displayed
onError: function () { //Callback on error
return;
},
mailInputName: 'newsletter_mail', //default mail input name
firstNameInputName: 'newsletter_first_name', //default first name input name
lastNameInputName: 'newsletter_last_name', //default last name input name
loaderElt: null //There is a default SVG loader when is set to null, but you can put here you own loader in raw HTML
});
}());
Custom example
(function () {
'use strict';
mailchimpIt('.test_form', {
successMessage: 'Thanks for subscribing, you\'ll be notified for the next update !',
successMessageBefore: '<p>Hell Yeah !</p>',
loaderElt: '<p>Please Wait... <img src="img/myCustomLoader.gif"/></p>',
onSuccess: muCustomFunction()
});
}());
Want to use jQuery ? No problem
(function ($) {
'use strict';
$('.test_form').mailchimpIt({
successMessage: 'Thanks for subscribing, you\'ll be notified for the next update !',
successMessageBefore: '<p>Hell Yeah !</p>'
});
}(jQuery));
FAQs
Javascript Plugin that turn a form into a Mailchimp ready form
The npm package mailchimp-it receives a total of 2 weekly downloads. As such, mailchimp-it popularity was classified as not popular.
We found that mailchimp-it demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.