mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2024-12-25 10:33:07 +07:00
* Added ability to adjust priority to the mail message (#66) Co-authored-by: John Pastore <cbbm142@github.com> Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com>
This commit is contained in:
parent
db36373cbe
commit
44663f34dd
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
@ -55,3 +55,4 @@ jobs:
|
|||||||
from: github-actions
|
from: github-actions
|
||||||
attachments: ${{matrix.attachments}}
|
attachments: ${{matrix.attachments}}
|
||||||
convert_markdown: ${{matrix.convert_markdown}}
|
convert_markdown: ${{matrix.convert_markdown}}
|
||||||
|
priority: high
|
||||||
|
@ -48,6 +48,8 @@ Some features:
|
|||||||
convert_markdown: true
|
convert_markdown: true
|
||||||
# Optional attachments:
|
# Optional attachments:
|
||||||
attachments: attachments.zip,git.diff,./dist/static/main.js
|
attachments: attachments.zip,git.diff,./dist/static/main.js
|
||||||
|
# Optional priority: 'high', 'normal' (default) or 'low'
|
||||||
|
priority: low
|
||||||
```
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
@ -53,6 +53,9 @@ inputs:
|
|||||||
attachments:
|
attachments:
|
||||||
description: Files that will be added to mail message attachments (separated with comma)
|
description: Files that will be added to mail message attachments (separated with comma)
|
||||||
required: false
|
required: false
|
||||||
|
priority:
|
||||||
|
description: Set Priority level for the mail message to 'high', 'normal' (default) or 'low'
|
||||||
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: node12
|
using: node12
|
||||||
main: main.js
|
main: main.js
|
||||||
|
4
main.js
4
main.js
@ -47,6 +47,7 @@ async function main() {
|
|||||||
const attachments = core.getInput("attachments", { required: false })
|
const attachments = core.getInput("attachments", { required: false })
|
||||||
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 })
|
||||||
|
|
||||||
if (!username || !password) {
|
if (!username || !password) {
|
||||||
core.warning("Username and password not specified. You should only do this if you are using a self-hosted runner to access an on-premise mail server.")
|
core.warning("Username and password not specified. You should only do this if you are using a self-hosted runner to access an on-premise mail server.")
|
||||||
@ -74,7 +75,8 @@ async function main() {
|
|||||||
replyTo: replyTo ? replyTo : undefined,
|
replyTo: replyTo ? replyTo : undefined,
|
||||||
text: body ? getBody(body, false) : undefined,
|
text: body ? getBody(body, false) : undefined,
|
||||||
html: htmlBody ? getBody(htmlBody, convertMarkdown) : undefined,
|
html: htmlBody ? getBody(htmlBody, convertMarkdown) : undefined,
|
||||||
attachments: attachments ? attachments.split(',').map(f => ({ path: f.trim() })) : undefined
|
attachments: attachments ? attachments.split(',').map(f => ({ path: f.trim() })) : undefined,
|
||||||
|
priority: priority ? priority : undefined,
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message)
|
core.setFailed(error.message)
|
||||||
|
Loading…
Reference in New Issue
Block a user