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

@@ -116,6 +116,27 @@ const youGotANewPostTemplate = (profile, userEmail, senderProfile, message) => {
sendEmail(userEmail, subject, html)
}
const youHaveAnInvitation = (invitedName, invitedEmail, senderProfile) => {
let subject = senderProfile.profile.firstName + " post on your profile";
let html = `
<p>Hello ${invitedName},</p>
<p>You have been invited to be part of the new efforts to be connected through our website.</p>
<p>The socila part of our site is a place to be in contact with the espiritual family, read what is new for all the members and have access to the most recent teachings, as well as our catalog of courses.</p>
<p><a href="https://social.emmint.com/">Register to make an account at https://social.emmint.com/</a></p>
<p> Invitation sent by:
${senderProfile.profile.firstName} ${senderProfile.profile.lastName}
</p>
<p>Blessings</p>
<p>Emmanuel International Ministries</p>
`;
sendEmail(invitedEmail, subject, html)
}
const Notifications = {
sendEmail,
async yourBookmarkedPostGotAComment(post, postProfile, senderProfile, message) {
@@ -182,7 +203,8 @@ const Notifications = {
const notifBody = `${senderProfile.profile.firstName} post in your profile`;
DB.addNotification(toProfileId, notifBody, post._id);
return youGotANewPostTemplate(profile, user.username, senderProfile, message);
}
},
youHaveAnInvitation
}
module.exports = Notifications