forked from mhayashi/express-helpers
-
Notifications
You must be signed in to change notification settings - Fork 13
mail_to
tanema edited this page Mar 18, 2012
·
1 revision
Creats a mail to link
options
-
encode: this can be set to "javascript" or "hex" so that the mailing can be handled with either methods, but the default will be handled with a normal mailto link
-
cc
-
bcc
-
subject
-
body
mail_to("me@domain.com","Send Me Email",{"encode":"hex","subject":"that thing I sent you","body":"did you get that thing I sent you"}) => <a href='mailto:%6D%65%40%64%6F%6D%61%69%6E%2E%63%6F%6D?body=did%20you%20get%20that%20thing%20I%20sent%20you&subject=that%20thing%20I%20sent%20you' >Send Me Email</a> <%- mail_to("me@domain.com", "Send Me Email", {encode : "javascript", subject: "that thing I sent you", body: "did you get that thing I sent you"}) %> => <script type="text/javascript">eval(decodeURIComponent('%64%6F%63%75%6D%65%6E%74%2E%77%72%69%74%65%28%27%3C%61%20%68%72%65%66%3D%5C%27%6D%61%69%6C%74%6F%3A%6D%65%40%64%6F%6D%61%69%6E%2E%63%6F%6D%3F%62%6F%64%79%3D%64%69%64%25%32%30%79%6F%75%25%32%30%67%65%74%25%32%30%74%68%61%74%25%32%30%74%68%69%6E%67%25%32%30%49%25%32%30%73%65%6E%74%25%32%30%79%6F%75%26%73%75%62%6A%65%63%74%3D%74%68%61%74%25%32%30%74%68%69%6E%67%25%32%30%49%25%32%30%73%65%6E%74%25%32%30%79%6F%75%5C%27%20%3E%53%65%6E%64%20%4D%65%20%45%6D%61%69%6C%3C%2F%61%3E%27%29%3B'))</script> <%- mail_to("me@domain.com", "Send Me Email", {subject: "that thing I sent you", body: "did you get that thing I sent you"}) %> => <a href='mailto:me@domain.com?body=did%20you%20get%20that%20thing%20I%20sent%20you&subject=that%20thing%20I%20sent%20you' >Send Me Email</a>