mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2025-07-05 14:43:15 +07:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
7ac0fb1e36 | |||
88cb2160ee | |||
abb4c87fd6 | |||
e04abb1cc1 | |||
c624d7739b |
@ -14,7 +14,7 @@ Some features:
|
||||
|
||||
```yaml
|
||||
- name: Send mail
|
||||
uses: dawidd6/action-send-mail@v3
|
||||
uses: dawidd6/action-send-mail@v4
|
||||
with:
|
||||
# Specify connection via URL (replaces server_address, server_port, secure,
|
||||
# username and password)
|
||||
@ -64,6 +64,10 @@ Some features:
|
||||
nodemailerlog: false
|
||||
# Optional nodemailerdebug: true/false if true lognodem will also be set true
|
||||
nodemailerdebug: false
|
||||
# Optional custom SMTP MAIL FROM address (overrides username):
|
||||
envelope_from: mailer@example.com
|
||||
# Optional custom SMTP RCPT TO addresses (overrides to, cc, bcc):
|
||||
envelope_to: mailer@example.com,admin@example.com
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
@ -63,6 +63,12 @@ inputs:
|
||||
nodemailerdebug:
|
||||
description: Debug option for nodemailer
|
||||
required: false
|
||||
envelope_from:
|
||||
description: Custom envelope sender address for SMTP MAIL FROM command
|
||||
required: false
|
||||
envelope_to:
|
||||
description: Custom envelope recipient addresses for SMTP RCPT TO command (separated with comma)
|
||||
required: false
|
||||
runs:
|
||||
using: node20
|
||||
main: main.js
|
||||
|
6
main.js
6
main.js
@ -99,6 +99,8 @@ async function main() {
|
||||
const priority = core.getInput("priority", { required: false })
|
||||
const nodemailerlog = core.getInput("nodemailerlog", { required: false })
|
||||
const nodemailerdebug = core.getInput("nodemailerdebug", { required: false })
|
||||
const envelopeFrom = core.getInput("envelope_from", { required: false })
|
||||
const envelopeTo = core.getInput("envelope_to", { required: false })
|
||||
|
||||
// if neither to, cc or bcc is provided, throw error
|
||||
if (!to && !cc && !bcc) {
|
||||
@ -140,6 +142,10 @@ async function main() {
|
||||
html: htmlBody ? getText(htmlBody, convertMarkdown) : undefined,
|
||||
priority: priority ? priority : undefined,
|
||||
attachments: attachments ? (await getAttachments(attachments)) : undefined,
|
||||
envelope: (envelopeFrom || envelopeTo) ? {
|
||||
from: envelopeFrom ? envelopeFrom : undefined,
|
||||
to: envelopeTo ? envelopeTo : undefined
|
||||
} : undefined
|
||||
});
|
||||
break;
|
||||
} catch (error) {
|
||||
|
15
package-lock.json
generated
15
package-lock.json
generated
@ -8,7 +8,7 @@
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/glob": "^0.4.0",
|
||||
"nodemailer": "^6.9.16",
|
||||
"nodemailer": "^6.10.1",
|
||||
"showdown": "^1.9.1"
|
||||
}
|
||||
},
|
||||
@ -184,9 +184,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nodemailer": {
|
||||
"version": "6.9.16",
|
||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.16.tgz",
|
||||
"integrity": "sha512-psAuZdTIRN08HKVd/E8ObdV6NO7NTBY3KsC30F7M4H1OnmLCUNaS56FpYxyb26zWLSyYF9Ozch9KYHhHegsiOQ==",
|
||||
"version": "6.10.1",
|
||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.10.1.tgz",
|
||||
"integrity": "sha512-Z+iLaBGVaSjbIzQ4pX6XV41HrooLsQ10ZWPUehGmuantvzWoDVBnmsdUcOIDM1t+yPor5pDhVlDESgOMEGxhHA==",
|
||||
"license": "MIT-0",
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
@ -490,9 +491,9 @@
|
||||
}
|
||||
},
|
||||
"nodemailer": {
|
||||
"version": "6.9.16",
|
||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.9.16.tgz",
|
||||
"integrity": "sha512-psAuZdTIRN08HKVd/E8ObdV6NO7NTBY3KsC30F7M4H1OnmLCUNaS56FpYxyb26zWLSyYF9Ozch9KYHhHegsiOQ=="
|
||||
"version": "6.10.1",
|
||||
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.10.1.tgz",
|
||||
"integrity": "sha512-Z+iLaBGVaSjbIzQ4pX6XV41HrooLsQ10ZWPUehGmuantvzWoDVBnmsdUcOIDM1t+yPor5pDhVlDESgOMEGxhHA=="
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "2.3.0",
|
||||
|
@ -4,7 +4,7 @@
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/glob": "^0.4.0",
|
||||
"nodemailer": "^6.9.16",
|
||||
"nodemailer": "^6.10.1",
|
||||
"showdown": "^1.9.1"
|
||||
}
|
||||
}
|
||||
|
1
testdata/subject.txt
vendored
1
testdata/subject.txt
vendored
@ -1 +0,0 @@
|
||||
Plain body (Markdown)
|
Reference in New Issue
Block a user