mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2025-07-24 23:59:07 +07:00
support multipart email (#48)
Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com>
This commit is contained in:
12
main.js
12
main.js
@ -36,13 +36,13 @@ async function main() {
|
||||
const username = core.getInput("username", { required: true })
|
||||
const password = core.getInput("password", { required: true })
|
||||
const subject = core.getInput("subject", { required: true })
|
||||
const body = core.getInput("body", { required: true })
|
||||
const from = core.getInput("from", { required: true })
|
||||
const to = core.getInput("to", { required: true })
|
||||
const body = core.getInput("body", { required: false })
|
||||
const htmlBody = core.getInput("html_body", { required: false })
|
||||
const cc = core.getInput("cc", { 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 attachments = core.getInput("attachments", { required: false })
|
||||
const convertMarkdown = core.getInput("convert_markdown", { required: false })
|
||||
const ignoreCert = core.getInput("ignore_cert", { required: false })
|
||||
@ -59,16 +59,16 @@ async function main() {
|
||||
rejectUnauthorized: false
|
||||
} : undefined
|
||||
})
|
||||
|
||||
|
||||
const info = await transport.sendMail({
|
||||
from: getFrom(from, username),
|
||||
to: to,
|
||||
subject: subject,
|
||||
cc: cc ? cc : undefined,
|
||||
bcc: bcc ? bcc : undefined,
|
||||
replyTo: replyTo ? replyTo : undefined,
|
||||
subject: subject,
|
||||
text: contentType != "text/html" ? getBody(body, convertMarkdown) : undefined,
|
||||
html: contentType == "text/html" ? getBody(body, convertMarkdown) : undefined,
|
||||
text: body ? getBody(body, convertMarkdown) : undefined,
|
||||
html: htmlBody ? getBody(htmlBody, convertMarkdown) : undefined,
|
||||
attachments: attachments ? attachments.split(',').map(f => ({ path: f.trim() })) : undefined
|
||||
})
|
||||
} catch (error) {
|
||||
|
Reference in New Issue
Block a user