mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2024-12-26 11:03:06 +07:00
Enable logging and debug of nodemailer (#190)
This should help A LOT to let people understand why things go wrong in this action when talking to the mailhost
This commit is contained in:
parent
48476814b0
commit
dc13c734ff
@ -60,6 +60,10 @@ Some features:
|
|||||||
attachments: attachments.zip,git.diff,./dist/static/*.js
|
attachments: attachments.zip,git.diff,./dist/static/*.js
|
||||||
# Optional priority: 'high', 'normal' (default) or 'low'
|
# Optional priority: 'high', 'normal' (default) or 'low'
|
||||||
priority: low
|
priority: low
|
||||||
|
# Optional nodemailerlog: true/false
|
||||||
|
nodemailerlog: false
|
||||||
|
# Optional nodemailerdebug: true/false if true lognodem will also be set true
|
||||||
|
nodemailerdebug: false
|
||||||
```
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
@ -57,6 +57,12 @@ inputs:
|
|||||||
priority:
|
priority:
|
||||||
description: Set Priority level for the mail message to 'high', 'normal' (default) or 'low'
|
description: Set Priority level for the mail message to 'high', 'normal' (default) or 'low'
|
||||||
required: false
|
required: false
|
||||||
|
nodemailerlog:
|
||||||
|
description: Log option for nodemailer
|
||||||
|
required: false
|
||||||
|
nodemailerdebug:
|
||||||
|
description: Debug option for nodemailer
|
||||||
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: node16
|
using: node16
|
||||||
main: main.js
|
main: main.js
|
||||||
|
4
main.js
4
main.js
@ -91,6 +91,8 @@ async function main() {
|
|||||||
const convertMarkdown = core.getInput("convert_markdown", { required: false })
|
const convertMarkdown = core.getInput("convert_markdown", { required: false })
|
||||||
const ignoreCert = core.getInput("ignore_cert", { required: false })
|
const ignoreCert = core.getInput("ignore_cert", { required: false })
|
||||||
const priority = core.getInput("priority", { required: false })
|
const priority = core.getInput("priority", { required: false })
|
||||||
|
const nodemailerlog = core.getInput("nodemailerlog", { required: false })
|
||||||
|
const nodemailerdebug = core.getInput("nodemailerdebug", { required: false })
|
||||||
|
|
||||||
// if neither to, cc or bcc is provided, throw error
|
// if neither to, cc or bcc is provided, throw error
|
||||||
if (!to && !cc && !bcc) {
|
if (!to && !cc && !bcc) {
|
||||||
@ -112,6 +114,8 @@ async function main() {
|
|||||||
tls: ignoreCert == "true" ? {
|
tls: ignoreCert == "true" ? {
|
||||||
rejectUnauthorized: false
|
rejectUnauthorized: false
|
||||||
} : undefined,
|
} : undefined,
|
||||||
|
logger: nodemailerdebug == "true" ? true : nodemailerlog,
|
||||||
|
debug: nodemailerdebug,
|
||||||
})
|
})
|
||||||
|
|
||||||
const info = await transport.sendMail({
|
const info = await transport.sendMail({
|
||||||
|
Loading…
Reference in New Issue
Block a user