pixl-mail 1.0.8 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/mail.js +2 -2
- package/package.json +4 -4
- package/.npmignore +0 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Overview
|
|
2
2
|
|
|
3
|
-
This module provides a very simple e-mail sender, which leans heavily on the awesome [nodemailer](https://nodemailer.com/) package. It layers on the ability to pass in a complete e-mail message with headers and body in one string (or file), and optionally perform placeholder substitution using [
|
|
3
|
+
This module provides a very simple e-mail sender, which leans heavily on the awesome [nodemailer](https://nodemailer.com/) package. It layers on the ability to pass in a complete e-mail message with headers and body in one string (or file), and optionally perform placeholder substitution using [sub()](https://www.npmjs.com/package/pixl-tools#sub) from the [pixl-tools](https://www.npmjs.com/package/pixl-tools) package. Auto-detects HTML or plain text e-mail body, and supports custom headers and attachments as well.
|
|
4
4
|
|
|
5
5
|
# Usage
|
|
6
6
|
|
|
@@ -43,7 +43,7 @@ For multiple recipients, simply separate them by commas on the `To` line. You c
|
|
|
43
43
|
|
|
44
44
|
## Placeholder Substitution
|
|
45
45
|
|
|
46
|
-
The library supports a simple e-mail templating system, where you can insert `[bracket_placeholders]` in your e-mail message, and have the library fill them with appropriate content from a separate object. This feature uses the [
|
|
46
|
+
The library supports a simple e-mail templating system, where you can insert `[bracket_placeholders]` in your e-mail message, and have the library fill them with appropriate content from a separate object. This feature uses the [sub()](https://www.npmjs.com/package/pixl-tools#sub) function from the [pixl-tools](https://www.npmjs.com/package/pixl-tools) package.
|
|
47
47
|
|
|
48
48
|
As an example, imagine a welcome e-mail for a new user who has signed up for your app. You have the welcome e-mail "template" stored separately, and want to fill in the user's e-mail address, full name and username at sending time. Here is how to do this:
|
|
49
49
|
|
|
@@ -79,7 +79,7 @@ Dear Joseph Huckaby,
|
|
|
79
79
|
Welcome to My App! Your username is 'jhuckaby'.
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
You can actually use a complex hash / array tree of arguments, and then specify `[
|
|
82
|
+
You can actually use a complex hash / array tree of arguments, and then specify `[filesystem/style/paths]` or `[dot.style.paths]` in your placeholders. See the [sub()](https://www.npmjs.com/package/pixl-tools#sub) docs for details.
|
|
83
83
|
|
|
84
84
|
## Loading From Files
|
|
85
85
|
|
|
@@ -164,9 +164,9 @@ mail.setOptions({
|
|
|
164
164
|
|
|
165
165
|
# License
|
|
166
166
|
|
|
167
|
-
The MIT License (MIT)
|
|
167
|
+
**The MIT License (MIT)**
|
|
168
168
|
|
|
169
|
-
Copyright (c) 2015 -
|
|
169
|
+
*Copyright (c) 2015 - 2019 Joseph Huckaby.*
|
|
170
170
|
|
|
171
171
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
172
172
|
of this software and associated documentation files (the "Software"), to deal
|
package/mail.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Simple SMTP Email Sender
|
|
2
|
-
// Copyright (c) 2015 Joseph Huckaby
|
|
2
|
+
// Copyright (c) 2015 - 2019 Joseph Huckaby
|
|
3
3
|
// Released under the MIT License
|
|
4
4
|
|
|
5
5
|
var fs = require('fs');
|
|
@@ -59,7 +59,7 @@ module.exports = Class.create({
|
|
|
59
59
|
if (!callback) callback = function() {};
|
|
60
60
|
|
|
61
61
|
// perform placeholder substitution on body
|
|
62
|
-
if (args) data = Tools.
|
|
62
|
+
if (args) data = Tools.sub( data, args );
|
|
63
63
|
|
|
64
64
|
// fix line endings
|
|
65
65
|
data = data.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pixl-mail",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "A very simple class for sending e-mail via SMTP.",
|
|
5
5
|
"author": "Joseph Huckaby <jhuckaby@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/jhuckaby/pixl-mail",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"smtp"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"nodemailer": "
|
|
23
|
-
"pixl-tools": "
|
|
24
|
-
"pixl-class": "
|
|
22
|
+
"nodemailer": "6.6.1",
|
|
23
|
+
"pixl-tools": "^1.0.19",
|
|
24
|
+
"pixl-class": "^1.0.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
|
package/.npmignore
DELETED