diff options
| author | Adam Soltys <[email protected]> | 2021-08-09 20:55:17 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-08-09 20:55:17 -0700 |
| commit | 56559c7b9749fe62fe2fe0ba90725391d83b8bf7 (patch) | |
| tree | 48d6a0630d05d6787b4410708a5efceff472636b /lib/mail.js | |
| parent | 803ecab2b5c3a00d107372ea6757cd6ce0f8224d (diff) | |
| parent | 8d6f65079868ae6134f593752e3380180591623d (diff) | |
| download | coinos-server-56559c7b9749fe62fe2fe0ba90725391d83b8bf7.tar.gz coinos-server-56559c7b9749fe62fe2fe0ba90725391d83b8bf7.zip | |
Merge branch 'v1.0.0'
Diffstat (limited to 'lib/mail.js')
| -rw-r--r-- | lib/mail.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/mail.js b/lib/mail.js index 705880d2..ca2c2b81 100644 --- a/lib/mail.js +++ b/lib/mail.js @@ -10,6 +10,38 @@ function openInbox(cb) { imap.openBox("INBOX", true, cb); } +app.post( + "/contact-sil", + ah((req, res) => { + const mailgun = require("mailgun-js")(config.mailgun); + let data = { + subject: "Contact form", + text: JSON.stringify(req.body), + from: "[email protected]", + to: "[email protected]" + }; + + mailgun.messages().send(data); + res.send(req.body); + }) +); + +app.post( + "/contact", + ah((req, res) => { + const mailgun = require("mailgun-js")(config.mailgun); + let data = { + subject: "Contact form", + text: JSON.stringify(req.body), + from: "[email protected]", + to: "[email protected]" + }; + + mailgun.messages().send(data); + res.send(req.body); + }) +); + imap.once("ready", function() { openInbox(function(err, box) { if (err) throw err; |
