[web] update copy in email notifications (#32912)

* add footerMessage to base email template
* add customized subject line and CTA
* add _getBundledActivityList

GitOrigin-RevId: e70c0955485b0892f31e20daa0430faef80b0d64
This commit is contained in:
Kristina
2026-04-23 08:07:01 +00:00
committed by Copybot
parent a64d1bbb6a
commit b6ec7945f4
3 changed files with 56 additions and 0 deletions
@@ -209,6 +209,46 @@ describe('EmailBuilder', function () {
}).to.throw(Error)
})
})
describe('footerMessage', function () {
it('should default footerMessage to undefined when not provided', function (ctx) {
const template = ctx.EmailBuilder.ctaTemplate({
subject: () => 'Subject',
message: () => ['Message'],
ctaText: () => 'Click',
ctaURL: () => 'https://example.com',
})
expect(template.footerMessage({})).to.be.undefined
})
it('should use the provided footerMessage callback', function (ctx) {
const template = ctx.EmailBuilder.ctaTemplate({
subject: () => 'Subject',
message: () => ['Message'],
ctaText: () => 'Click',
ctaURL: () => 'https://example.com',
footerMessage: () => 'Custom footer text',
})
expect(template.footerMessage({})).to.equal('Custom footer text')
})
it('should include footerMessage in plain text output when provided', function (ctx) {
ctx.EmailBuilder.templates.testFooterTemplate =
ctx.EmailBuilder.ctaTemplate({
subject: () => 'Test Subject',
message: () => ['Body message'],
ctaText: () => 'Go',
ctaURL: () => 'https://example.com',
footerMessage: (opts, isPlainText) =>
isPlainText ? 'Plain footer' : '<b>HTML footer</b>',
})
const email = ctx.EmailBuilder.buildEmail('testFooterTemplate', {
to: 'test@example.com',
})
expect(email.text).to.contain('Plain footer')
delete ctx.EmailBuilder.templates.testFooterTemplate
})
})
})
describe('templates', function () {