@@ -3,6 +3,7 @@ import { Resend } from 'resend'
33import { z } from 'zod'
44import { env } from '@/lib/env'
55import { createLogger } from '@/lib/logs/console-logger'
6+ import { getBaseDomain } from '@/lib/urls/utils'
67
78const resend = env . RESEND_API_KEY ? new Resend ( env . RESEND_API_KEY ) : null
89const logger = createLogger ( 'HelpAPI' )
@@ -98,8 +99,8 @@ ${message}
9899
99100 // Send email using Resend
100101 const { data, error } = await resend . emails . send ( {
101- from : ' Sim Studio <noreply@simstudio.ai>' ,
102- to : [ ' help@simstudio.ai' ] ,
102+ from : ` Sim Studio <noreply@${ getBaseDomain ( ) } >` ,
103+ to : [ ` help@${ getBaseDomain ( ) } ` ] ,
103104 subject : `[${ type . toUpperCase ( ) } ] ${ subject } ` ,
104105 replyTo : email ,
105106 text : emailText ,
@@ -121,7 +122,7 @@ ${message}
121122 // Send confirmation email to the user
122123 await resend . emails
123124 . send ( {
124- from : ' Sim Studio <noreply@simstudio.ai>' ,
125+ from : ` Sim Studio <noreply@${ getBaseDomain ( ) } >` ,
125126 to : [ email ] ,
126127 subject : `Your ${ type } request has been received: ${ subject } ` ,
127128 text : `
@@ -137,7 +138,7 @@ ${images.length > 0 ? `You attached ${images.length} image(s).` : ''}
137138Best regards,
138139The Sim Studio Team
139140 ` ,
140- replyTo : ' help@simstudio.ai' ,
141+ replyTo : ` help@${ getBaseDomain ( ) } ` ,
141142 } )
142143 . catch ( ( err ) => {
143144 logger . warn ( `[${ requestId } ] Failed to send confirmation email` , err )
0 commit comments