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:
Bernhard 2024-01-05 18:40:18 +01:00 committed by GitHub
parent 48476814b0
commit dc13c734ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -60,6 +60,10 @@ Some features:
attachments: attachments.zip,git.diff,./dist/static/*.js
# Optional priority: 'high', 'normal' (default) or 'low'
priority: low
# Optional nodemailerlog: true/false
nodemailerlog: false
# Optional nodemailerdebug: true/false if true lognodem will also be set true
nodemailerdebug: false
```
## Troubleshooting

View File

@ -57,6 +57,12 @@ inputs:
priority:
description: Set Priority level for the mail message to 'high', 'normal' (default) or 'low'
required: false
nodemailerlog:
description: Log option for nodemailer
required: false
nodemailerdebug:
description: Debug option for nodemailer
required: false
runs:
using: node16
main: main.js

View File

@ -91,6 +91,8 @@ async function main() {
const convertMarkdown = core.getInput("convert_markdown", { required: false })
const ignoreCert = core.getInput("ignore_cert", { 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 (!to && !cc && !bcc) {
@ -112,6 +114,8 @@ async function main() {
tls: ignoreCert == "true" ? {
rejectUnauthorized: false
} : undefined,
logger: nodemailerdebug == "true" ? true : nodemailerlog,
debug: nodemailerdebug,
})
const info = await transport.sendMail({