From 7dcd3223b9f4dd550902aa8be44c19a46b8a42f2 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Tue, 24 Mar 2020 13:32:53 +0100 Subject: [PATCH] main: restore content_type and delete html --- main.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 505cad4a..75a2eb50 100644 --- a/main.js +++ b/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)