393 |
394 |
395 |
396 |
397 |
398 |
399 |
432 |
433 | |
434 |
435 |
436 |
437 |
438 |
462 |
463 | |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 | {{{heading}}}
481 |
482 | {{{headingSmall}}}
483 |
484 | {{#eachLine message}}{{{this}}} {{/eachLine}}
485 |
486 | |
487 |
488 |
489 |
490 | |
491 |
492 |
493 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 | {{#eachLine messageAfterButton}} {{{this}}} {{/eachLine}}
523 |
524 | |
525 |
526 |
527 |
528 | |
529 |
530 |
531 | |
532 |
533 |
534 |
535 | |
536 |
537 |
538 |
539 |
540 |
844 |
845 | |
846 |
847 |
848 |
849 | |
850 |
851 |
852 |
853 |
854 |
855 |
--------------------------------------------------------------------------------
/lib/templates/shared/footer.handlebars:
--------------------------------------------------------------------------------
1 | You are getting this message because you signed up to {{siteName}}, a product managed by {{companyName}}. {{companyAddress}}. {{companyTelephone}} {{companyEmail}}
2 |
--------------------------------------------------------------------------------
/package.js:
--------------------------------------------------------------------------------
1 | Package.describe({
2 | name: "yogiben:pretty-email",
3 | summary: "Send pretty emails",
4 | version: "0.0.7",
5 | git: "https://github.com/yogiben/meteor-pretty-email"
6 | });
7 |
8 | Package.onUse(function(api) {
9 | api.versionsFrom('METEOR@1.0');
10 |
11 | api.use('coffeescript');
12 | api.use('email');
13 | api.use('underscore');
14 | api.use([
15 | 'accounts-base',
16 | 'accounts-password'
17 | ], { weak: true });
18 | api.use('cmather:handlebars-server@2.0.0');
19 |
20 | api.addFiles(
21 | [
22 | 'lib/server/pretty-emails.coffee',
23 | 'lib/templates/shared/footer.handlebars',
24 | 'lib/templates/call-to-action.handlebars',
25 | 'lib/templates/basic.handlebars'
26 | ],
27 | 'server');
28 |
29 | api.export('PrettyEmail', 'server');
30 | });
31 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | Send pretty emails
2 | ==================
3 |
4 | `meteor add yogiben:pretty-email`
5 |
6 | ### What this package does ###
7 | 1. Replaces boring default Meteor emails
8 | 2. Easily send pretty emails with call to action buttons
9 |
10 | 
11 |
12 |
13 | ### Usage ###
14 |
15 | 1) Install the package
16 |
17 | 2) Set up global options
18 |
19 | e.g.
20 |
21 | ```
22 | PrettyEmail.options =
23 | from: 'support@mycompany.com'
24 | logoUrl: 'http://mycompany.com/logo.png'
25 | companyName: 'myCompany'
26 | companyUrl: 'http://mycompany.com'
27 | companyAddress: '123 Street, ZipCode, City, Country'
28 | companyTelephone: '+1234567890'
29 | companyEmail: 'support@mycompany.com'
30 | siteName: 'mycompany'
31 | ```
32 |
33 | 3) Send your emails
34 |
35 | ```
36 | Accounts.sendVerificationEmail Meteor.userId()
37 | Accounts.sendResetPasswordEmail Meteor.userId()
38 | Accounts.sendEnrollmentEmail Meteor.userId()
39 | ```
40 |
41 | or using template
42 |
43 | ```
44 | PrettyEmail.send 'call-to-action',
45 | to: 'myuser@myuser.com'
46 | subject: 'You got new message'
47 | heading: 'Your friend sent you a message'
48 | message: 'Click the button below to read the message'
49 | buttonText: 'Read message'
50 | buttonUrl: 'http://mycompany.com/messages/2314'
51 | messageAfterButton: "I come after the button!"
52 | ```
53 |
54 | ### Templates ###
55 |
56 | #### Call to action ####
57 |
58 | 
59 |
60 | ```
61 | PrettyEmail.send 'call-to-action', options
62 | ```
63 |
64 | **Options**
65 |
66 | ``from`` - required
67 |
68 | ``to`` - required
69 |
70 | ``subject`` - required
71 |
72 | ``heading`` - required. Primary heading
73 |
74 | ``headingSmall`` - optional. Secondary heading
75 |
76 | ``message`` - required. Message to the user (e.g. 'Your bill has been paid')
77 |
78 | ``buttonText`` - required. e.g. 'See your bill'
79 |
80 | ``buttonUrl`` - required. e.g. 'http://mycompany.com/bills/12341234'
81 |
82 | #### Basic ####
83 |
84 | 
85 |
86 | Similar to call-to-action template except that it doesn't have a button and text is not centered.
87 |
88 | **Options**
89 |
90 | ``from`` - required
91 |
92 | ``to`` - required
93 |
94 | ``subject`` - required
95 |
96 | ``heading`` - required. Primary heading
97 |
98 | ``headingSmall`` - optional. Secondary heading
99 |
100 | ``message`` - required. Message to the user (e.g. 'Your bill has been paid')
101 |
102 | ### Global options ###
103 |
104 | You can set your options globally with ``PrettyEmail.options`` object. ``PrettyEmail.send`` will merge this object with options argument so you can put here some other values (e.g. ``from`` ``to`` ``subject``).
105 |
106 | ``showFooter`` - default true
107 |
108 | ``showFollowBlock`` - default true
109 |
110 | ``facebook`` ``twitter`` ``googlePlus`` ``instagram`` ``pinterest`` ``youtube`` ``linkedin`` ``tumblr`` ``website`` ``email`` - links to specific social medias
111 |
112 | ``companyName`` - name of your company (must be specified otherwise footer won't be rendered)
113 |
114 | ``companyUrl`` - url of your company website
115 |
116 | ``companyEmail`` - email of your company
117 |
118 | ``companyAddress`` - address of your company
119 |
120 | ``companyTelephone`` - telephone number of your company
121 |
122 | ``siteName`` - name of your website
123 |
124 | ### Custom style ###
125 |
126 | You can change the style of your emails by manipulating ``PrettyEmail.style`` object. See default values below:
127 |
128 | ```
129 | PrettyEmail.style =
130 | fontFamily: 'Helvetica'
131 | textColor: '#606060'
132 | buttonColor: '#FFFFFF'
133 | buttonBgColor: '#007FFF'
134 | ```
135 |
136 | ### Customizing Accounts emails ###
137 | You can change the text in the verification email etc.
138 |
139 | e.g.
140 |
141 | ```
142 | PrettyEmail.defaults.verifyEmail =
143 | heading: 'Need to activate your account'
144 | buttonText: 'Activate'
145 | ...
146 | ```
147 |
--------------------------------------------------------------------------------
/readme/basic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yogiben/meteor-pretty-email/0c5390b5e43163e43b345cd197fae5d9c7935b7e/readme/basic.png
--------------------------------------------------------------------------------
/readme/call-to-action.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yogiben/meteor-pretty-email/0c5390b5e43163e43b345cd197fae5d9c7935b7e/readme/call-to-action.png
--------------------------------------------------------------------------------
/readme/meteor-pretty-email.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yogiben/meteor-pretty-email/0c5390b5e43163e43b345cd197fae5d9c7935b7e/readme/meteor-pretty-email.png
--------------------------------------------------------------------------------
/versions.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": [
3 | [
4 | "accounts-base",
5 | "1.1.2"
6 | ],
7 | [
8 | "accounts-password",
9 | "1.0.4"
10 | ],
11 | [
12 | "application-configuration",
13 | "1.0.3"
14 | ],
15 | [
16 | "base64",
17 | "1.0.1"
18 | ],
19 | [
20 | "binary-heap",
21 | "1.0.1"
22 | ],
23 | [
24 | "callback-hook",
25 | "1.0.1"
26 | ],
27 | [
28 | "check",
29 | "1.0.2"
30 | ],
31 | [
32 | "cmather:handlebars-server",
33 | "0.2.0"
34 | ],
35 | [
36 | "coffeescript",
37 | "1.0.4"
38 | ],
39 | [
40 | "ddp",
41 | "1.0.11"
42 | ],
43 | [
44 | "ejson",
45 | "1.0.4"
46 | ],
47 | [
48 | "email",
49 | "1.0.4"
50 | ],
51 | [
52 | "follower-livedata",
53 | "1.0.2"
54 | ],
55 | [
56 | "geojson-utils",
57 | "1.0.1"
58 | ],
59 | [
60 | "handlebars",
61 | "1.0.1"
62 | ],
63 | [
64 | "id-map",
65 | "1.0.1"
66 | ],
67 | [
68 | "json",
69 | "1.0.1"
70 | ],
71 | [
72 | "localstorage",
73 | "1.0.1"
74 | ],
75 | [
76 | "logging",
77 | "1.0.5"
78 | ],
79 | [
80 | "meteor",
81 | "1.1.3"
82 | ],
83 | [
84 | "minimongo",
85 | "1.0.5"
86 | ],
87 | [
88 | "mongo",
89 | "1.0.8"
90 | ],
91 | [
92 | "npm-bcrypt",
93 | "0.7.7"
94 | ],
95 | [
96 | "ordered-dict",
97 | "1.0.1"
98 | ],
99 | [
100 | "random",
101 | "1.0.1"
102 | ],
103 | [
104 | "retry",
105 | "1.0.1"
106 | ],
107 | [
108 | "service-configuration",
109 | "1.0.2"
110 | ],
111 | [
112 | "sha",
113 | "1.0.1"
114 | ],
115 | [
116 | "srp",
117 | "1.0.1"
118 | ],
119 | [
120 | "tracker",
121 | "1.0.3"
122 | ],
123 | [
124 | "underscore",
125 | "1.0.1"
126 | ]
127 | ],
128 | "pluginDependencies": [],
129 | "toolVersion": "meteor-tool@1.0.35",
130 | "format": "1.0"
131 | }
--------------------------------------------------------------------------------
|