Skip to content

Commit

Permalink
Enable logging and debug of nodemailer (#190)
Browse files Browse the repository at this point in the history
This should help A LOT to let people understand
why things go wrong in this action when talking to the mailhost
  • Loading branch information
furtber authored Jan 5, 2024
1 parent 4847681 commit dc13c73
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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({
Expand Down

0 comments on commit dc13c73

Please sign in to comment.