Ghost/ghost/staff-service/lib/email-templates/donation.txt.js
Ronald Langeveld e8e1b8ea2f
Added donation message to Stripe and Email (#20828)
ref PLG-160

- Refactored donation handling logic to be processed within the
`checkout.session.completed` webhook event.
- Added support for capturing and storing donation messages from Stripe
sessions.
- Integrated donation messages into the email notifications sent to
staff.
- Added database integration.
- Removed redundant donation logic from the invoice.payment_succeeded
webhook, since custom fields isn't supported.
- Updated and added new tests

---------

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2024-08-28 21:08:42 +09:00

16 lines
515 B
JavaScript

module.exports = function (data) {
// Be careful when you indent the email, because whitespaces are visible in emails!
return `
Cha-ching!
You received a one-time payment from of ${data.donation.amount} from "${data.donation.name}".
Message: ${data.donation.donationMessage ? data.donation.donationMessage : 'No message provided'}
---
Sent to ${data.toEmail} from ${data.siteDomain}.
If you would no longer like to receive these notifications you can adjust your settings at ${data.staffUrl}.
`;
};