-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Done with nodemailer and its functioning
- Loading branch information
1 parent
65bd57a
commit b56b648
Showing
16 changed files
with
1,277 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const express = require('express'); | ||
const router = express.Router(); | ||
const { sendUserEmail } = require("../utils/sendUsermail"); | ||
|
||
router.post('/sendUserEmail', async (req, res) => { | ||
try { | ||
const { to,subject, message } = req.body; | ||
await sendUserEmail(to,subject, message); // Call your backend function to send email | ||
|
||
res.status(200).send('Email sent successfully'); | ||
} catch (error) { | ||
console.error('Error sending email:', error); | ||
res.status(500).send('Failed to send email'); | ||
} | ||
}); | ||
|
||
module.exports = router; |
Oops, something went wrong.