File tree Expand file tree Collapse file tree 4 files changed +13575
-8146
lines changed
Expand file tree Collapse file tree 4 files changed +13575
-8146
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,15 @@ import { Resend } from 'resend'
22
33const FROM_EMAIL = 'Alex Patterson <alex@codingcat.dev>'
44
5+ /** Lazy Resend client — only created when actually needed (avoids build-time crash) */
6+ let _resend : Resend | null = null
7+ function getResendClient ( ) : Resend {
8+ if ( ! _resend ) {
9+ _resend = new Resend ( process . env . RESEND_API_KEY )
10+ }
11+ return _resend
12+ }
13+
514/**
615 * Send a sponsor-related email via Resend.
716 * Falls back to console logging if RESEND_API_KEY is not set.
Original file line number Diff line number Diff line change 5757 "@sanity/image-url" : " ^2.0.3" ,
5858 "@sanity/preview-url-secret" : " ^4.0.3" ,
5959 "@sanity/studio-secrets" : " ^4.0.1" ,
60+ "@sanity/table" : " ^2.0.1" ,
6061 "@sanity/ui" : " ^3.1.13" ,
6162 "@sanity/vision" : " ^5.12.0" ,
6263 "@sanity/webhook" : " ^4.0.4" ,
You can’t perform that action at this time.
0 commit comments