fixing email template

This commit is contained in:
Arjun Patel
2019-04-22 02:58:17 -07:00
parent 0ec8bb7468
commit 1f16e88fc6
2 changed files with 26 additions and 6 deletions
+15 -1
View File
@@ -6,6 +6,7 @@ const sendgrid = require('./sendgrid.controller');
const {
Grant,
Donor,
Charge,
Cause,
Region,
@@ -82,11 +83,24 @@ exports.createGrant = async (req, res, next) => {
{ transaction }
);
const donors = await sequelize.query(
`
SELECT email, first_name, last_name
FROM donors
WHERE id = :donor_id
`,
{
type: db.Sequelize.QueryTypes.SELECT,
replacements: { donor_id: user.id }
}
);
// send email
await sendgrid.paymentReceipt({
grant,
organizations,
total_amount: actual_total,
receiver: user.email
receiver: donors[0]
});
// commit