File tree Expand file tree Collapse file tree 3 files changed +1
-23
lines changed
app/api/workspaces/invitations Expand file tree Collapse file tree 3 files changed +1
-23
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,6 @@ async function sendInvitationEmail({
250250 html : emailHtml ,
251251 from : fromAddress ,
252252 emailType : 'transactional' ,
253- useCustomFromFormat : true ,
254253 } )
255254
256255 if ( result . success ) {
Original file line number Diff line number Diff line change @@ -218,23 +218,6 @@ describe('mailer', () => {
218218 )
219219 } )
220220
221- it ( 'should use custom from format when useCustomFromFormat is true' , async ( ) => {
222- const result = await sendEmail ( {
223- ...testEmailOptions ,
224- from : 'Sim <noreply@sim.ai>' ,
225- useCustomFromFormat : true ,
226- } )
227-
228- expect ( result . success ) . toBe ( true )
229-
230- // Should call Resend with the exact from address provided (no modification)
231- expect ( mockSend ) . toHaveBeenCalledWith (
232- expect . objectContaining ( {
233- from : 'Sim <noreply@sim.ai>' , // Uses custom format as-is
234- } )
235- )
236- } )
237-
238221 it . concurrent ( 'should replace unsubscribe token placeholders in HTML' , async ( ) => {
239222 const htmlWithPlaceholder = '<p>Content</p><a href="{{UNSUBSCRIBE_TOKEN}}">Unsubscribe</a>'
240223
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ export interface EmailOptions {
2626 includeUnsubscribe ?: boolean
2727 attachments ?: EmailAttachment [ ]
2828 replyTo ?: string
29- useCustomFromFormat ?: boolean // If true, uses "from" as-is; if false, uses default FROM_EMAIL_ADDRESS format
3029}
3130
3231export interface BatchEmailOptions {
@@ -55,7 +54,6 @@ interface ProcessedEmailData {
5554 headers : Record < string , string >
5655 attachments ?: EmailAttachment [ ]
5756 replyTo ?: string
58- useCustomFromFormat : boolean
5957}
6058
6159const resendApiKey = env . RESEND_API_KEY
@@ -149,7 +147,6 @@ async function processEmailData(options: EmailOptions): Promise<ProcessedEmailDa
149147 includeUnsubscribe = true ,
150148 attachments,
151149 replyTo,
152- useCustomFromFormat = false ,
153150 } = options
154151
155152 const senderEmail = from || getFromEmailAddress ( )
@@ -186,14 +183,13 @@ async function processEmailData(options: EmailOptions): Promise<ProcessedEmailDa
186183 headers,
187184 attachments,
188185 replyTo,
189- useCustomFromFormat,
190186 }
191187}
192188
193189async function sendWithResend ( data : ProcessedEmailData ) : Promise < SendEmailResult > {
194190 if ( ! resend ) throw new Error ( 'Resend not configured' )
195191
196- const fromAddress = data . useCustomFromFormat ? data . senderEmail : data . senderEmail
192+ const fromAddress = data . senderEmail
197193
198194 const emailData : any = {
199195 from : fromAddress ,
You can’t perform that action at this time.
0 commit comments