feat: Add dedicated Sanctuary Tech Builder application approval email#89
Conversation
…pproval email template for successful applications.
✅ Deploy Preview for devcon-monorepo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for devcon-app canceled.
|
✅ Deploy Preview for devconnect-monorepo canceled.
|
✅ Deploy Preview for devconnect-pwa canceled.
|
✅ Deploy Preview for devcon-archive canceled.
|
✅ Deploy Preview for devcon-social canceled.
|
✅ Deploy Preview for devcon-event-app canceled.
|
| function buildApprovalHtml(name: string, voucherCode: string): string { | ||
| const greeting = name ? `Hi ${escapeHtml(name)},` : 'Hi,' | ||
| // Deep-link straight to the Pretix store with the voucher pre-applied. | ||
| const redeemUrl = pretixEventUrl(`/redeem?voucher=${encodeURIComponent(voucherCode)}`) |
There was a problem hiding this comment.
Non-blocking, would it be worth displaying the voucher code and/or claim link to the user in plain text the email, instead of only as a link href?
There was a problem hiding this comment.
My instinct was that the flow would be seamless enough (tap > land in Pretix > Confirm product) that it is unlikely anyone would need to do the manual version. I will add this in as a backup though – thanks for the feedback!
| } | ||
|
|
||
| const result = await issueBuilderVoucher(email, builderIdentities(record)) | ||
| const result = await issueBuilderVoucher(email, builderIdentities(record), String(record['Full Name'] || '')) |
There was a problem hiding this comment.
If I'm correct here, a repeat submission would fire off another email. Not a huge deal, but seems like there is guard against this above on the "reject" side of the flow but not here. Non-blocking, just noting for consideration
There was a problem hiding this comment.
Noted! Will include this same dedup mechanism in a follow up commit.
| // Only email on the transition INTO Approved (like the reject side) — but | ||
| // keyed on Voucher Sent rather than Decision alone, so a failed first send | ||
| // can still be retried by re-approving. | ||
| const alreadyEmailed = record['Decision'] === 'Approved' && Boolean(record['Voucher Sent']) |
There was a problem hiding this comment.
Just making sure the database won't misinterpret this as a "false" string since "false" as a string could be considered truthy. Pretty sure NocoDB would return real booleans here, but just wanted to confirm
There was a problem hiding this comment.
Confirmed it's a real boolean. Voucher Sent is a NocoDB Checkbox column (created with uidt: 'Checkbox' in setup-nocodb.ts), and I verified against the live base that the data API returns JSON booleans (false), not strings. Worst case the v1 data API used by nocodb-sdk serializes checkboxes as 0/1 on some backends, which Boolean() also handles correctly — a Checkbox column never comes back as a "false" string. (The default_value: "false" you'd see in the column metadata is just how NocoDB stores column defaults, not row values.) The admin UI already relies on the same truthiness at builder-review/[id].tsx (record['Voucher Sent'] ? 'Yes' : 'No'), which renders correctly in production.
| * Mint (or reuse) a builder voucher for this applicant and email it. Shared by | ||
| * the admin Approve action and the submit-time auto-approve. One voucher per |
There was a problem hiding this comment.
Existing, but seems to be only one caller here and not shared; may be worth patching this comment while in here
…removed) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Dedicated approval email for Sanctuary Tech Builder applications
What & why
Previously, approving a builder application sent the applicant the generic voucher email (
services/voucherEmail.ts) — the same template used by the ticket-store's manual re-send flow. Builders now get a dedicated approval email with program-specific copy (as requested by Ticketing), and the shared template is untouched for its remaining consumer.Changes
services/builder/email.ts— newsendBuilderApprovalEmail(email, voucherCode, name?)+ HTML template, built alongside the existing rejection email and reusing its layout/escapeHtml/sendMailplumbing.Your Sanctuary Tech Builder application has been approved 🎉pretixEventUrl('/redeem?voucher=<code>')(voucher pre-applied, visible code block available as a backup)issueBuilderVoucher()now sends the new email; gains an optionalnameparam. Voucher minting/reuse andsetVoucherEmail/setVoucherEmailSentbookkeeping unchanged.-
api/builder/review/[id].ts— passes the application's Full Name through for the greeting.services/voucherEmail.ts— comment-only: header now correctly documents its single consumer (the send-voucher-email re-send API) and points builder approvals to the new template.Not changed / behavior notes
Testing
tsc --noEmitclean for changed files.sendMailstubbed: verified subject/emoji, greeting interpolation with HTML escaping, redeem deep-link, mailto link, and bold formatting.