mailbox
What and why?
A few weeks ago it started: I started thinking about "mailto:" - Links. Those things everyone knows - and not just the web-savvy developers, but also each other the time has visited a website that has no contact.
The thing is the following: Each user has a mail program on his PC / Mac is harassed with every time after you click on a mailto link with the charging of the program. Only to send a little message. Even if you have so much brains and the corresponding event handler in its own browser adapts, remains one next to the mail program, only the automatic opening an online webmail.
I thought to myself: Why do you do this because not a lot easier, and especially pleasant for the users? So I have got a jQuery plugin called "mailbox" (The name should be short and concise) wrote that on a mailto link provides a schniekes contact form on click.
The idea of the appearance of mailbox came übrigends of Balloon.io .
Installation
First, you should just include the necessary files in the head section of your page:
<Link rel = "stylesheet" type = "text / css" href = "mailbox.css" />
<Script src = "http://code.jquery.com/jquery-1.10.1.min.js"> </ script>
<Script src = "jquery.mailbox.js"> </ script>
Connecting nurnoch mailbox must be assigned to a link:
$ (Function () {
$ ('A [href ^ = "mailto:"]') mailbox ().
});
Configuration
Of course, should also like you and the visitors of your website the plugin. For this reason, you have the opportunity to make some changes to mailbox without ever touching the source code. This is best done configuring specific variables. All possible options and related example texts are listed.
$ ('A [href ^ = "mailto:"]') mailbox ({.
send_text: 'Send Message', // content of the button, which is used to send the message
success_text: 'Your message was sent successfully!', // text in the shipment confirmation
label: {
name: 'Your Name', // title of the name field
email: 'Email', // title of the E-mail field
subject: 'Subject', // title of the subject field
message: 'message' // title of the message box
}
send_url: 'mb_send.php', // URL to PHP script (responsible for shipping)
complete: function () {alert ('Done!');} // This function is executed after successful mission
});
The best part of the whole thing
It is not necessary to define a recipient's address in the script to configure nor any other important things such as the subject or the e-mail address to which a copy / Bcc to go.
Why not? It's simple: As we all know, can mailto links next to the recipient's e-mail address, also contain other attributes, such as the desired subject the contents of the message or the address is sent to a copy of the message should. This means for the developers: In addition to the integration of the script, no changes need to be made to the mail links. Thus, quite simply, is not it? ;-)
https://github.com/leo/mailbox