send invitations emails
This commit is contained in:
@@ -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"
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user