Mailto link obfuscation helper
npm install @threespot/mailto
 
Replaces obscured element with a mailto link
``bash`
npm install @threespot/mailto
Mailto uses the data-email attribute of an element and converts them to mailto links. It uses the value of that attribute as the email address. Inner HTML is preserved and any occurrences of [at] are converted to @.
Exmaple:
`html`
Contact Us
Becomes:
`html`
Contact Us
Works with inner HTML
Exmaple:
`html`
hello[at]threespot.com
Becomes:
`html`
hello@threespot.com
html
`html`
Contact Us
js
`js
import MailToLink from "@threespot/mailto";
const linkElem = document.getElementById("mailtoLink");
new MailToLink(linkElem);
``
Mailto is free software, and may be redistributed under the terms of the MIT license.
Threespot is a design and development agency from Washington, DC. We work for organizations that we believe are making a positive change in the world. Find out more about us, our projects or hire us!
