Add replyTo field support (#41)

Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com>
This commit is contained in:
Dominik Krzywiecki 2021-04-07 18:34:58 +01:00 committed by GitHub
parent f1b626cfd4
commit 3ce6fdc63e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,8 @@ An action that simply sends a mail to multiple recipients.
cc: kyloren@example.com,leia@example.com cc: kyloren@example.com,leia@example.com
# Optional blind carbon copy recipients # Optional blind carbon copy recipients
bcc: r2d2@example.com,hansolo@example.com bcc: r2d2@example.com,hansolo@example.com
# Optional recipient of the email response
reply_to: luke@example.com
# Optional unsigned/invalid certificates allowance: # Optional unsigned/invalid certificates allowance:
ignore_cert: true ignore_cert: true
# Optional content type (defaults to text/plain): # Optional content type (defaults to text/plain):

View File

@ -35,6 +35,9 @@ inputs:
bcc: bcc:
description: Blind carbon copy recipients (separated with comma) description: Blind carbon copy recipients (separated with comma)
required: false required: false
reply_to:
description: An email address that will appear on the Reply-To field
required: false
ignore_cert: ignore_cert:
description: Allow unsigned/invalid certificates description: Allow unsigned/invalid certificates
required: false required: false

View File

@ -41,6 +41,7 @@ async function main() {
const to = core.getInput("to", { required: true }) const to = core.getInput("to", { required: true })
const cc = core.getInput("cc", { required: false }) const cc = core.getInput("cc", { required: false })
const bcc = core.getInput("bcc", { required: false }) const bcc = core.getInput("bcc", { required: false })
const replyTo = core.getInput("reply_to", { 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 })
@ -64,6 +65,7 @@ async function main() {
to: to, to: to,
cc: cc ? cc : undefined, cc: cc ? cc : undefined,
bcc: bcc ? bcc : undefined, bcc: bcc ? bcc : undefined,
replyTo: replyTo ? replyTo : 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,