angular-mailto
v0.1.0
Published
Create mailto: strings to use in link href attributes.
Downloads
138
Readme
angular-mailto
A simple service that generates a mailto: string that can be used in an <a href="">.
Installation
Through bower:
bower install angular-mailto --saveUsage
Include angular-mailto.js in your application and add the module uz.mailto as a dependency to your app module
var myapp = angular.module('myapp', ['uz.mailto']);The Mailto service
The Mailto service can be used to generate a mailto: string:
var recepient = "[email protected]";
var options = {
cc: "[email protected]",
bcc: "[email protected]",
subject: "Angular-mailto Email",
body: "Hi Stefan,\nThis is an email pre-populated from angular-mailto."
};
var href = Mailto.url(recepient, options);This will generate the appropriate mailto string:
mailto:stefan%40dontgohere.com?cc=cc.this.person%40dontgohere.com&bcc=bcc.this.person%40dontgohere.com&subject=Angular-mailto%20Email&body=Hi%20Stefan%2C%0AThis%20is%20an%20email%20pre-populated%20from%20angular-mailto.you can then use this inside an <a> tag:
<a href="{{href}}">email me</a>- All
optionsare optional. - For linebreaks / newlines in the email body, use the
\ncharacter.
License
Released under the terms of MIT License. See LICENSE.
