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
@@ -974,6 +974,35 @@ templates.removeGroupMember = NoCTAEmailTemplate({
},
})
templates.taxExemptCertificateRequired = NoCTAEmailTemplate({
subject(opts) {
return `Action required: Tax exemption verification for Overleaf [${opts.ein}]`
},
title() {
return 'Action required: Tax exemption verification'
},
greeting() {
return ''
},
message(opts) {
return [
'Thanks for letting us know your organization is tax exempt. To confirm this, we need some additional verification.',
'Please reply to this email with one of the following documents attached:',
'<ul>',
'<li>Your IRS determination letter (for non-profits and similar organizations)</li>',
'<li>Your state resale or exemption certificate</li>',
'</ul>',
`These should match the EIN you provided:${opts.ein}.`,
'If you have any questions, let us know by replying to this email.',
'<br/>',
'Best wishes,',
'Team Overleaf',
'<br/>',
`Our reference:${opts.stripeCustomerId}`,
]
},
})
function _formatUserNameAndEmail(user, placeholder) {
if (user.first_name && user.last_name) {
const fullName = `${user.first_name} ${user.last_name}`
@@ -104,6 +104,9 @@ async function sendEmail(options, emailType) {
replyTo: options.replyTo || EMAIL_SETTINGS.replyToAddress,
socketTimeout: 30 * 1000,
}
if (options.cc) {
sendMailOptions.cc = options.cc
}
if (EMAIL_SETTINGS.textEncoding != null) {
sendMailOptions.textEncoding = EMAIL_SETTINGS.textEncoding
}