main: restore content_type and delete html

This commit is contained in:
Dawid Dziurla 2020-03-24 13:32:53 +01:00
parent 47fc78c33b
commit 7dcd3223b9
No known key found for this signature in database
GPG Key ID: 7B6D8368172E9B0B

View File

@ -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)