send invitations emails

This commit is contained in:
Adolfo Reyna
2021-10-10 10:50:42 -07:00
parent c64e2361fc
commit dce98a30c6
4 changed files with 27 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ var router = express.Router()
const DB = require("../mongoDB.js");
const Profile = require("../def/profile.js");
const Notifications = require("./../notifications.js");
DB.getDB.then((DB)=>{
@@ -59,6 +60,8 @@ DB.getDB.then((DB)=>{
let r = await DB.newInvitation(userid, name, email);
if(!r.toLowerCase){
//send email invitation
let senderProfile = await DB.getProfile(getProfileId(req));
Notifications.youHaveAnInvitation(name, email, senderProfile);
return res.json({
status: "ok"
});