mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2024-12-26 19:13:06 +07:00
commit
2ae7800184
@ -19,6 +19,10 @@ An action that simply sends a mail to multiple recipients.
|
|||||||
body: file://README.md
|
body: file://README.md
|
||||||
to: obiwan@tatooine.com,yoda@dagobah.com
|
to: obiwan@tatooine.com,yoda@dagobah.com
|
||||||
from: Luke Skywalker # <user@example.com>
|
from: Luke Skywalker # <user@example.com>
|
||||||
|
# Optional carbon copy recipients
|
||||||
|
cc: kyloren@starkiller.com,leia@alderaan.com
|
||||||
|
# Optional blind carbon copy recipients
|
||||||
|
bcc: r2d2@jakku.com,hansolo@milleniumfalcon.com
|
||||||
# Optional content type (defaults to text/plain):
|
# Optional content type (defaults to text/plain):
|
||||||
content_type: text/html
|
content_type: text/html
|
||||||
# Optional converting Markdown to HTML (set content_type to text/html too):
|
# Optional converting Markdown to HTML (set content_type to text/html too):
|
||||||
|
@ -29,6 +29,12 @@ inputs:
|
|||||||
from:
|
from:
|
||||||
description: Full name of mail sender (might be with an email address specified in <>)
|
description: Full name of mail sender (might be with an email address specified in <>)
|
||||||
required: true
|
required: true
|
||||||
|
cc:
|
||||||
|
description: Carbon copy recipients (separated with comma)
|
||||||
|
required: false
|
||||||
|
bcc:
|
||||||
|
description: Blind carbon copy recipients (separated with comma)
|
||||||
|
required: false
|
||||||
content_type:
|
content_type:
|
||||||
description: Content-Type HTTP header (text/html or text/plain)
|
description: Content-Type HTTP header (text/html or text/plain)
|
||||||
required: false
|
required: false
|
||||||
|
6
main.js
6
main.js
@ -37,8 +37,10 @@ async function main() {
|
|||||||
const password = core.getInput("password", { required: true })
|
const password = core.getInput("password", { required: true })
|
||||||
const subject = core.getInput("subject", { required: true })
|
const subject = core.getInput("subject", { required: true })
|
||||||
const body = core.getInput("body", { required: true })
|
const body = core.getInput("body", { required: true })
|
||||||
const to = core.getInput("to", { required: true })
|
|
||||||
const from = core.getInput("from", { required: true })
|
const from = core.getInput("from", { required: true })
|
||||||
|
const to = core.getInput("to", { required: true })
|
||||||
|
const cc = core.getInput("cc", { required: false })
|
||||||
|
const bcc = core.getInput("bcc", { required: false })
|
||||||
const contentType = core.getInput("content_type", { required: true })
|
const contentType = core.getInput("content_type", { required: true })
|
||||||
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 })
|
||||||
@ -58,6 +60,8 @@ async function main() {
|
|||||||
const info = await transport.sendMail({
|
const info = await transport.sendMail({
|
||||||
from: getFrom(from, username),
|
from: getFrom(from, username),
|
||||||
to: to,
|
to: to,
|
||||||
|
cc: cc ? cc : undefined,
|
||||||
|
bcc: bcc ? bcc : undefined,
|
||||||
subject: subject,
|
subject: subject,
|
||||||
text: contentType != "text/html" ? getBody(body, convertMarkdown) : undefined,
|
text: contentType != "text/html" ? getBody(body, convertMarkdown) : undefined,
|
||||||
html: contentType == "text/html" ? getBody(body, convertMarkdown) : undefined,
|
html: contentType == "text/html" ? getBody(body, convertMarkdown) : undefined,
|
||||||
|
Loading…
Reference in New Issue
Block a user