diff options
| author | Adam Soltys <[email protected]> | 2022-06-10 02:28:18 -0400 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-06-10 02:29:18 -0400 |
| commit | b43147612face13a481eb01f79e43c753d10b34f (patch) | |
| tree | d877eedf68b464efc7c8110925126fb743a8bbc9 /index.js | |
| parent | c1dff6b22b1e9659943be4ab98b9e0c06e4b11e2 (diff) | |
| download | coinos-server-b43147612face13a481eb01f79e43c753d10b34f.tar.gz coinos-server-b43147612face13a481eb01f79e43c753d10b34f.zip | |
send email with postmark
Diffstat (limited to 'index.js')
| -rw-r--r-- | index.js | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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({ + From: "[email protected]", + To: "[email protected]", + 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); } |
