properly showing date for tax receipt through sendgrid

This commit is contained in:
Arjun Patel
2019-04-24 00:34:47 -07:00
parent 1f16e88fc6
commit 59d220d5d7
2 changed files with 29 additions and 2 deletions
+5 -2
View File
@@ -1,5 +1,6 @@
const db = require('../../models'),
errorMaker = require('../helpers/error.maker');
errorMaker = require('../helpers/error.maker'),
dateFunctions = require('../helpers/dates');
const sgMail = require('@sendgrid/mail');
sgMail.setApiKey(process.env.SENDGRID_KEY);
@@ -26,6 +27,8 @@ exports.paymentReceipt = async ({
</tr>`;
});
let currDate = new Date().toDateString();
const msg = {
to: receiver.email,
from: { email: '[email protected]', name: 'Charify Payments' },
@@ -37,7 +40,7 @@ exports.paymentReceipt = async ({
bundle_id: grant.id,
charities_list: charitiesHtml,
total_amount,
date: grant.created_at,
date: currDate,
subject: 'Your Charify Bundle Payment - Charify'
}
};