Improving comments
This commit is contained in:
@@ -11,6 +11,7 @@ const sendWebNotification = async (subscription, title, body) => {
|
||||
webPush.sendNotification(subscription, payload);
|
||||
}
|
||||
|
||||
// Expo API to send push notifications, this code was a provided snipped
|
||||
const sendPushNotification = async (profileToken, body, data) => {
|
||||
if (!profileToken) return 0;
|
||||
let expo = new Expo();
|
||||
@@ -94,6 +95,10 @@ const sendPushNotification = async (profileToken, body, data) => {
|
||||
})();
|
||||
}
|
||||
|
||||
|
||||
// API to send emails from specific domain.
|
||||
// TODO: Replace by a generic function, and specifics should be provided
|
||||
// via enviroment variables.
|
||||
const sendEmail = async (to, subject, html) => {
|
||||
let transporter = nodemailer.createTransport({
|
||||
host: "mail.emmint.com",
|
||||
@@ -114,6 +119,9 @@ const sendEmail = async (to, subject, html) => {
|
||||
if (info && info.messageId) console.log("Email sent: %s", info.messageId);
|
||||
};
|
||||
|
||||
// Specific Notification templates
|
||||
// TODO: This should be replaced by a system of tempaltes.
|
||||
|
||||
const yourBookmarkedPostGotACommentTemplate = (post, userEmail, postProfile, senderProfile, bookedProfile, message) => {
|
||||
let subject = senderProfile.profile.firstName + " commented on the post you follow";
|
||||
let html = `
|
||||
|
||||
Reference in New Issue
Block a user