8000 Update smtp.js · rboss/log4js-node@1629e01 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1629e01

Browse files
author
sc2bigjoe
committed
Update smtp.js
added the ability for smtp appender to send message as html instead of plaintext. in your log4js.config file simply include "html": "true", to write out as html, otherwise it will send plaintext
1 parent ec5f448 commit 1629e01

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/appenders/smtp.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@ function smtpAppender(config, layout) {
3434
var msg = 8D98 {
3535
to: config.recipients,
3636
subject: config.subject || subjectLayout(firstEvent),
37-
text: body,
3837
headers: { "Hostname": os.hostname() }
3938
};
39+
40+
if (!config.html) {
41+
msg.text = body;
42+
} else {
43+
msg.html = body;
44+
}
45+
4046
if (config.sender) {
4147
msg.from = config.sender;
4248
}

0 commit comments

Comments
 (0)
0