Mailchecker on DSMX

Recently, I saw quite useful jQuery plugin which was introduced on the Japanese Geek website, aka Gigazine.
It says, it could reduced 50% of returned email because of typo or wrong email address which visitor registered in user registration form.

Kicksend/mailcheck · GitHub
https://github.com/Kicksend/mailcheck

How we decreased sign up confirmation email bounces by 50% – The Kicksend Blog
http://blog.kicksend.com/how-we-decreased-sign-up-confirmation-email-bounces-by-50/

Because I love to try to integrate any kind of useful jQuery plugin into DSMX, so let me share how you can do it at here.

mailcheck.js

The Javascript library and jQuery plugin that suggests a right domain when your users misspell it in an email address.

Example on DSMX

Just try to type ‘test@hotmai.con’ or ‘test@gmai.com’. It will suggest you most close actual domain name.

mailcheck example

OK, now here is how to integrate it into DSMX.

1. Upload .js file

upload-jsfile

2. Load .js in the page
Please replace server domain, campaign name, account ID according to your setting.

LoadJS

3. Add class name or ID to the input element

AddClassName

4.Place div element where it should display suggestion

HintPlaceHolder

5. Place Javascript.

mailcheck-JavaScript

Here is my script.

You can add any domain or topLevelDomains in the array. Or simply comment it out, then it will take default value from .js file.

var domains = ['hotmail.com', 'gmail.com', 'aol.com','directsmile.com'];
var topLevelDomains = ["com", "net", "org"];
$('.email').on('blur', function() {
 $(this).mailcheck({
 domains: domains, // optional
 topLevelDomains: topLevelDomains, // optional
 // distanceFunction: superStringDistance, // optional
 suggested: function(element, suggestion) {
 // callback code
 var suggestion = '<table> <tbody> <tr> <td width="80" valign="top" align="left" style=""> <img width="80" height="147" src="template_image/man with query.png" /> </td> <td valign="top" align="left" style=""> <p>Did you mean</p><p class="sug">'+suggestion.full+' ?</p></tr> </tbody> </table>';
 $('#hint').html(suggestion).fadeIn(150)
 },
 empty: function(element) {
 // callback code
 var suggestion = '<table> <tbody> <tr> <td width="80" valign="top" align="left" style=""> <img width="80" src="template_image/serving document.PNG" /> </td> <td valign="top" align="left" style=""> <p>Looks like your email address is valid!</p></p></tr></tbody></table>';
 $('#hint').html(suggestion).fadeIn(150)
 }
 });
});

 

Have a fun!! 🙂

広告