Merge pull request #28898 from overleaf/ls-send-email-for-tax-exempt-certificate

Send email if tax exempt certificate is required

GitOrigin-RevId: 685fec7dbb129eab19095470e681d09423558e4c
This commit is contained in:
Liangjun Song
2025-10-10 08:05:22 +00:00
committed by Copybot
parent b8da04078d
commit 2153fd7fa5
3 changed files with 83 additions and 0 deletions
@@ -880,6 +880,57 @@ describe('EmailBuilder', function () {
})
})
})
describe('taxExemptCertificateRequired', function () {
beforeEach(function () {
this.emailAddress = 'customer@example.com'
this.opts = {
to: this.emailAddress,
ein: '12-3456789',
stripeCustomerId: 'cus_123456789',
}
this.email = this.EmailBuilder.buildEmail(
'taxExemptCertificateRequired',
this.opts
)
this.dom = cheerio.load(this.email.html)
})
it('should build the email', function () {
expect(this.email.html).to.exist
expect(this.email.text).to.exist
})
describe('HTML email', function () {
it('should include the EIN', function () {
expect(this.email.html).to.contain(this.opts.ein)
})
it('should include the Stripe customer ID', function () {
expect(this.email.html).to.contain(this.opts.stripeCustomerId)
})
it('should include tax exemption verification text', function () {
expect(this.email.html).to.contain('tax exempt')
expect(this.email.html).to.contain('verification')
})
})
describe('plain text email', function () {
it('should include the EIN', function () {
expect(this.email.text).to.contain(this.opts.ein)
})
it('should include the Stripe customer ID', function () {
expect(this.email.text).to.contain(this.opts.stripeCustomerId)
})
it('should include tax exemption verification text', function () {
expect(this.email.text).to.contain('tax exempt')
expect(this.email.text).to.contain('verification')
})
})
})
})
})
})