W
Wasp-lang•4mo ago
Estelle

How can I custom the verification email content?

+ Can I use SendGrid template?
2 Replies
kapa.ai
kapa.ai•4mo ago
Hi @Estelle. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- You can customize the verification email content in Wasp by defining a function that returns the content of the email. This function should be defined in a file in the src directory. Here is an example of how you can do it:
import { GetVerificationEmailContentFn } from 'wasp/server/auth'

export const getVerificationEmailContent: GetVerificationEmailContentFn = ({
verificationLink,
}) => ({
subject: 'Verify your email',
text: `Click the link below to verify your email: ${verificationLink}`,
html: `
<p>Click the link below to verify your email</p>
<a href="${verificationLink}">Verify email</a>
`,
})
import { GetVerificationEmailContentFn } from 'wasp/server/auth'

export const getVerificationEmailContent: GetVerificationEmailContentFn = ({
verificationLink,
}) => ({
subject: 'Verify your email',
text: `Click the link below to verify your email: ${verificationLink}`,
html: `
<p>Click the link below to verify your email</p>
<a href="${verificationLink}">Verify email</a>
`,
})
This is the default content of the email, but you can customize it to your liking. The verificationLink is the link that the user needs to click to verify their email. You can customize the subject, text, and html fields to change the email's subject, text content, and HTML content, respectively. source (https://wasp-lang.dev/docs/auth/email#emailverification-emailverificationconfig-) As for using SendGrid templates, currently, Wasp does not support specifying provider-specific options like templateId for SendGrid. However, this is a feature that is being considered for future implementation. You can follow the progress of this feature request on this Github issue (https://github.com/wasp-lang/wasp/issues/1553). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Estelle, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
miho
miho•4mo ago
Bot is correct 😊
Want results from more Discord servers?
Add your server
More Posts