@promise-watch/smtp
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -8,3 +8,3 @@ import { Notifier, SendOptions } from "@promise-watch/core"; | ||
constructor(transport: SMTPTransport | SMTPTransport.Options | string, sendInfo: Mail.Options); | ||
send({ title, body }: SendOptions): Promise<void>; | ||
send({ title, body, isSuccess }: SendOptions): Promise<void>; | ||
} |
@@ -10,7 +10,11 @@ "use strict"; | ||
} | ||
async send({ title, body }) { | ||
async send({ title, body, isSuccess }) { | ||
const subject = isSuccess ? `${title} has recovered.` : `${title} seems down!`; | ||
await this.transporter.sendMail({ | ||
subject: title, | ||
text: body, | ||
html: `<p>${body}</p>`, | ||
subject, | ||
text: `${subject} | ||
${body} | ||
`, | ||
html: `<h2>${subject}</h2><p>${body}</p>`, | ||
...this.sendInfo, | ||
@@ -17,0 +21,0 @@ }); |
{ | ||
"name": "@promise-watch/smtp", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"main": "dist/index.js", | ||
@@ -11,3 +11,3 @@ "author": "Jason Raimondi <jason@raimondi.us> (https://jasonraimondi.com)", | ||
"dependencies": { | ||
"@promise-watch/core": "^0.0.7", | ||
"@promise-watch/core": "^0.0.8", | ||
"nodemailer": "^6.7.2" | ||
@@ -14,0 +14,0 @@ }, |
@@ -13,7 +13,11 @@ import { Notifier, SendOptions } from "@promise-watch/core"; | ||
async send({ title, body }: SendOptions): Promise<void> { | ||
async send({ title, body, isSuccess }: SendOptions): Promise<void> { | ||
const subject = isSuccess ? `${title} has recovered.` : `${title} seems down!`; | ||
await this.transporter.sendMail({ | ||
subject: title, | ||
text: body, | ||
html: `<p>${body}</p>`, | ||
subject, | ||
text: `${subject} | ||
${body} | ||
`, | ||
html: `<h2>${subject}</h2><p>${body}</p>`, | ||
...this.sendInfo, | ||
@@ -20,0 +24,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5626
52
+ Added@promise-watch/core@0.0.8(transitive)
- Removed@promise-watch/core@0.0.7(transitive)
Updated@promise-watch/core@^0.0.8