fix email notifications for new posts on groups
This commit is contained in:
@@ -186,7 +186,7 @@ const Notifications = {
|
||||
DB.addNotification(post.profileid, notifBody, postId, post.comments.length - 1);
|
||||
return youGotANewPostCommentTemplate(post, userEmail, postProfile, senderProfile, message);
|
||||
},
|
||||
async yourGroupGotANewPost(groupProfile, senderProfile, message) {
|
||||
async yourGroupGotANewPost(groupProfile, senderProfile, message, post) {
|
||||
const DB = await DBGetter.getDB;
|
||||
let subscribedPromise = Object.keys(groupProfile.subscribed).map((profileid) => {
|
||||
return DB.getProfileCache(profileid);
|
||||
@@ -213,7 +213,7 @@ const Notifications = {
|
||||
const user = await DB.getUserById(profile.userid);
|
||||
const senderProfile = await DB.getProfileCache(whoPostedId);
|
||||
if (profile.isGroup) {
|
||||
return this.yourGroupGotANewPost(profile, senderProfile, message);
|
||||
return this.yourGroupGotANewPost(profile, senderProfile, message, post);
|
||||
}
|
||||
const notifBody = `${senderProfile.profile.firstName} post in your profile`;
|
||||
DB.addNotification(toProfileId, notifBody, post._id);
|
||||
|
||||
Reference in New Issue
Block a user