aboutsummaryrefslogtreecommitdiffstats
path: root/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rw-r--r--index.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/index.js b/index.js
index 07576f11..3e0cd436 100644
--- a/index.js
+++ b/index.js
@@ -109,6 +109,27 @@ app.post("/email", async (req, res) => {
let file = persist("data/emails.json");
file.emails = [...file.emails, req.body];
res.send({ ok: true });
+
+ try {
+ // Require:
+ var postmark = require("postmark");
+
+ // Send an email:
+ var client = new postmark.ServerClient(
+ config.postmark
+ );
+
+ client.sendEmail({
+ Subject: "Email Signup",
+ HtmlBody: JSON.stringify(req.body),
+ TextBody: JSON.stringify(req.body),
+ MessageStream: "outbound"
+ });
+ } catch(e) {
+ console.log("problem sending email", e);
+ }
} catch (e) {
console.log(e);
}