mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2024-11-10 05:51:07 +07:00
main: restore content_type and delete html
This commit is contained in:
parent
47fc78c33b
commit
7dcd3223b9
9
main.js
9
main.js
@ -21,7 +21,7 @@ async function main() {
|
||||
const body = core.getInput("body", { required: true })
|
||||
const to = core.getInput("to", { required: true })
|
||||
const from = core.getInput("from", { required: true })
|
||||
const html = core.getInput("html") || "false"
|
||||
const content_type = core.getInput("content_type", { required: true })
|
||||
|
||||
const transport = nodemailer.createTransport({
|
||||
host: server_address,
|
||||
@ -37,8 +37,11 @@ async function main() {
|
||||
from: `"${from}" <${username}>`,
|
||||
to: to,
|
||||
subject: subject,
|
||||
text: html == "false" ? get_body(body) : undefined,
|
||||
html: html == "true" ? get_body(body) : undefined,
|
||||
text: content_type != "text/html" ? get_body(body) : undefined,
|
||||
html: content_type == "text/html" ? get_body(body) : undefined,
|
||||
headers: {
|
||||
"Content-Type": content_type
|
||||
}
|
||||
})
|
||||
|
||||
console.log(info)
|
||||
|
Loading…
Reference in New Issue
Block a user