#How do i send resend react email components??

1 messages · Page 1 of 1 (latest)

jaunty torrent
#

This is in auth.ts for convex auth

    id: "verification",
    apiKey: process.env.RESEND_API_KEY,
    maxAge: VerificationCodesExpiration,
    generateVerificationToken() {
      const random: RandomReader = {
        read(bytes) {
          crypto.getRandomValues(bytes)
        }
      }
      const alphabet = "0123456789"
      const length = 6
      return generateRandomString(random, alphabet, length)
    },
    async sendVerificationRequest({ identifier: email, provider, token }) {
      const resend = new ResendApi(provider.apiKey)
      const { error } = await resend.emails.send({
        from: `${siteConfig.name} <${siteConfig.email.noreply}>`,
        to: [email],
        subject: `Verify your email - ${siteConfig.name}`,
        text: `Your verification code is ${token}`,
        react: VerifyEmail({
          code: token,
          expiry: new Date(Date.now() + VerificationCodesExpiration * 1000)
        })
      })

      if (error) {
        throw new ConvexError({
          kind: "EmailSendFailed",
          message: error.toString() || "Failed to send verification email"
        })
      }
    }
  }),```

im getting a failed to send error
gray pikeBOT
#

Thanks for posting in #1088161997662724167.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.

    - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
    - Use [search.convex.dev](https://search.convex.dev) to search Docs, Stack, and Discord all at once.
    - Additionally, you can post your questions in the Convex Community's #1228095053885476985 channel to receive a response from AI.
    - Avoid tagging staff unless specifically instructed.

    Thank you!
lethal jacinth
jaunty torrent
#

i alrdy have that

lethal jacinth
#

What does the error tell you?

jaunty torrent
#

Uncaught ConvexError: {"kind":"EmailSendFailed","message":"[object Object]"}

#

and its probably related to react email

lethal jacinth
#

can you JSON.stringify(error)

jaunty torrent
#

12/11/2025, 11:06:31 PM [CONVEX A(auth:signIn)] Uncaught ConvexError: {"kind":"EmailSendFailed","message":""[object Object]""}

lethal jacinth
jaunty torrent
#

thats why im here

lethal jacinth
#

that's why i'm asking if you can stringify it

jaunty torrent
#

i did stringfy it

#

thats what it gave me

lethal jacinth
#

do you see anything on the dashboard?

jaunty torrent
#

im gonna try smth

#

@lethal jacinth question..I have these values in a ts object and env is basically a file that extracts env variables

email: {
noreply: noreply@${env.NEXT_PUBLIC_ROOT_DOMAIN},
support: support@${env.NEXT_PUBLIC_ROOT_DOMAIN},
team: team@${env.NEXT_PUBLIC_ROOT_DOMAIN},
newsletter: newsletter@${env.NEXT_PUBLIC_ROOT_DOMAIN}
},

#

do u think the issue is cuz convex cant pull up those public env variables?

#

cuz i checked my resend logs and it says cant send from noreply@undefined

lethal jacinth
#

you need to use proccess.env.{{Your variable name}} and add them to your convex environment variable list

jaunty torrent
#

I see

#

alrty

#

thank you

#

will try now

jaunty torrent
#

oki works