Skip to content

Commit

Permalink
Done with nodemailer and its functioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Pudi-Sravan committed Jun 22, 2024
1 parent 65bd57a commit b56b648
Show file tree
Hide file tree
Showing 16 changed files with 1,277 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ dist-ssr
.vscode/*
!.vscode/extensions.json
.idea
.env
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.env
/src/Back_end/.env
2 changes: 0 additions & 2 deletions src/.env

This file was deleted.

17 changes: 17 additions & 0 deletions src/Back_end/Routes/apiroutes.js
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;
Loading

0 comments on commit b56b648

Please sign in to comment.