Skip to content

Commit

Permalink
Email Improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
theolaa committed Jul 31, 2021
1 parent 26b6832 commit df6418d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cgi/bmi_calculator.pl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<body>
<h1> Hi </h1>
HTML
print ("<h1> $data{firstname}, Congratulations your account is successfully created! </h1>");
print ("<h1> <span id='name'>$data{firstname}</span>, Congratulations your account is successfully created! </h1>");
print ("<h2> Lets calculate your BMI! </h2>");
print <<HTML;
Expand Down Expand Up @@ -99,6 +99,7 @@
function sendEmail() {
result = document.getElementById("BMI-result").innerText;
bmi = document.getElementById("BMI").innerText;
name = document.getElementById("name").innerText;
if (result == "" && bmi == "")
{
alert("Enter Height & Weight");
Expand All @@ -109,7 +110,7 @@
To : "$data{email}",
From : "theolaanstra\@gmail.com",
Subject : "BMI Results",
Body : "Hi \\n Your BMI result says that \\"" + result + "\\"\\r\\nYour BMI is " + bmi
Body : "Hi " + name + ",\\n Your BMI result says that \\"" + result + "\\"\\r\\nYour BMI is " + bmi
}).then(
function(message) {
console.log("Email Status: " + message);
Expand Down

0 comments on commit df6418d

Please sign in to comment.