Skip to content
This repository was archived by the owner on Jan 22, 2021. It is now read-only.

Commit c0abf5f

Browse files
author
Steve Ross
committed
Merge branch 'master' of git://github.com/lookback/meteor-emails
Pulling down updates from upstream
2 parents c372836 + 69d6b0e commit c0abf5f

File tree

10 files changed

+168
-131
lines changed

10 files changed

+168
-131
lines changed

Diff for: .versions

+62-59
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,69 @@
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16-
17-
18-
19-
20-
21-
22-
23-
24-
25-
26-
27-
28-
29-
30-
local-test:lookback:[email protected]
31-
32-
33-
1+
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
local-test:lookback:[email protected]
32+
33+
34+
3435
meteorhacks:[email protected]
35-
meteorhacks:[email protected]
36-
37-
38-
39-
40-
41-
42-
36+
meteorhacks:[email protected]
37+
38+
39+
40+
41+
42+
43+
44+
45+
4346
practicalmeteor:[email protected]_1
4447
practicalmeteor:[email protected]_2
4548
practicalmeteor:[email protected]_7
4649
practicalmeteor:[email protected]
4750
practicalmeteor:[email protected]_2
48-
promise@0.5.1
49-
50-
51-
52-
53-
54-
51+
promise@0.6.7
52+
53+
54+
55+
56+
57+
5558
56-
57-
58-
59-
60-
61-
62-
63-
64-
65-
66-
59+
60+
61+
62+
63+
64+
65+
66+
67+
68+
69+

Diff for: README.md

+28-1
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,14 @@ Please inspect the provided sample code for details.
112112
from: 'Name <[email protected]>', // Override global 'From: ' option.
113113
cc: 'Name <[email protected]>', // Optional.
114114
bcc: 'Name <[email protected]>', // Optional.
115-
data: {} // Optional. Render your email with a data object.
115+
data: {}, // Optional. Render your email with a data object.
116+
attachments: [] // Optional. Attach files using a mailcomposer format, as an array of objects.
117+
// Read more here: http://docs.meteor.com/#/full/email_send and here: https://github.com/nodemailer/mailcomposer/blob/7c0422b2de2dc61a60ba27cfa3353472f662aeb5/README.md#add-attachments
116118
}
117119
```
118120

121+
*Note:* The official MailComposer README section on Attachment is apparently incorrect, as documented in [#69](https://github.com/lookback/meteor-emails/issues/69), or Meteor's `Email` is using an outdated version (probably the latter). So use `fileName`, `filePath`, etc. instead of `filename`, `path`, etc. when sending attachment objects.
122+
119123
## Usage
120124

121125
### Setting up templates
@@ -316,6 +320,25 @@ Templates.invitationEmail =
316320
layout: false
317321
```
318322
323+
The contents of the layout HTML file might look like:
324+
325+
```html
326+
<html xmlns="http://www.w3.org/1999/xhtml">
327+
<head>
328+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
329+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
330+
331+
<title>{{preview}}</title>
332+
</head>
333+
<body>
334+
<p class="hide preview-text">{{#if preview}}{{preview}}{{else}}Default preview.{{/if}}</p>
335+
336+
<!-- This is where the actual template content will be inserted. -->
337+
{{{ body }}}
338+
</body>
339+
</html>
340+
```
341+
319342
If you want to provide extra CSS to your layout's `<head>` section *from template* (perhaps custom media queries for that specific template) you can provide the `extraCSS` option:
320343
321344
```coffeescript
@@ -338,6 +361,8 @@ It's you to render the raw CSS in your layout:
338361
{{{ css }}}
339362
</style>
340363
</head>
364+
365+
<!-- ... -->
341366
</html>
342367
```
343368
@@ -472,6 +497,8 @@ Why not try [`meteor-logger`](https://github.com/lookback/meteor-logger)? :)
472497
473498
## Version history
474499
500+
- `0.7.4` - Fix incorrect Meteor root path in developer mode. Filed in [#66](https://github.com/lookback/meteor-emails/issues/66), fixed in [#67](https://github.com/lookback/meteor-emails/pull/67). Thanks @pierrelouisd4j!
501+
- `0.7.3`- Support for attachments (thanks @cubicuboctahedron!).
475502
- `0.7.2` - Support `cc` and `bcc` options to `Mailer.send()`. Filed in [#52](https://github.com/lookback/meteor-emails/issues/52), fixed in [#54](https://github.com/lookback/meteor-emails/pull/54).
476503
- `0.7.1` - Check for existence of `Blaze` global before extending with registered Blaze helpers.
477504
- `0.7.0` - Replaced Iron Router dependency with `meteorhacks:picker`, which means you can now use this package with FlowRouter as well.

Diff for: example/.meteor/.finished-upgraders

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ notices-for-facebook-graph-api-2
1010
1.2.0-meteor-platform-split
1111
1.2.0-cordova-changes
1212
1.2.0-breaking-changes
13+
1.3.0-split-minifiers-package

Diff for: example/.meteor/packages

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
ecmascript
88
lookback:emails
99
chrisbutler:[email protected]
10-
standard-minifiers
1110
meteor-base
1211
blaze-html-templates
1312
reload
1413
spacebars
1514
kadira:flow-router
1615
#iron:router
16+
standard-minifier-css
17+
standard-minifier-js

Diff for: example/.meteor/release

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
METEOR@1.2.0.2
1+
METEOR@1.3.2.4

Diff for: example/.meteor/versions

+68-65
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,70 @@
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
chrisbutler:[email protected]
15-
16-
17-
18-
19-
20-
21-
22-
23-
24-
25-
26-
27-
28-
29-
30-
31-
32-
33-
34-
35-
36-
37-
38-
39-
1+
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
chrisbutler:[email protected]
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
4039
meteorhacks:[email protected]
41-
meteorhacks:[email protected]
42-
43-
44-
45-
46-
47-
48-
49-
50-
51-
52-
53-
54-
55-
40+
meteorhacks:[email protected]
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
55+
56+
57+
5658
57-
58-
59-
60-
61-
62-
63-
64-
65-
66-
67-
59+
60+
61+
62+
63+
64+
65+
66+
67+
68+
69+
70+

Diff for: lib/mailer.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ const factory = (options) => {
233233
replyTo: Match.Optional(Match.OneOf(String, [String])),
234234
from: Match.Optional(String),
235235
data: Match.Optional(Object),
236-
headers: Match.Optional(Object)
236+
headers: Match.Optional(Object),
237+
attachments: Match.Optional([Object])
237238
});
238239

239240
const defaults = {

Diff for: lib/utils.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ const developmentPrivateDir = () => {
2525
if (!isDevEnv())
2626
return;
2727
// In development, using `pwd` is fine. Remove the .meteor/foo/bar stuff though.
28-
const meteorRoot = process.cwd().replace(/(\.meteor.*)/g, '');
28+
const reg = new RegExp(path.sep+'\.meteor.*','g');
29+
const meteorRoot = process.cwd().replace(reg, '');
2930
return path.join(meteorRoot, 'private');
3031
};
3132

Diff for: package.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var where = 'server';
44
Package.describe({
55
name: 'lookback:emails',
66
summary: 'Send HTML emails with server side Blaze templates. Preview and debug in the browser.',
7-
version: '0.7.2',
7+
version: '0.7.4',
88
git: 'https://github.com/lookback/meteor-emails.git'
99
});
1010

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lookback-emails",
3-
"version": "0.7.2",
3+
"version": "0.7.4",
44
"description": "`lookback:emails` is a Meteor package that makes it easier to build, test and debug rich HTML emails.",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)