Better Auth
Integrating Shootmail templates to send emails with better auth on authentication events like sign up, sign in, password reset, etc
Read this guide for more details on setting up Shootmail with Better Auth
Setup Shootmail SDK
If you are an existing user, just update the Shootmail SDK. If you are a new user, head to the SDK setup page
Setup Better Auth
Refer Better Auth documentation to get started
Integrating Shootmail templates
Clone the pre-built better auth email templates to further customize them. These pre-built email templates already have the required parameters configured. You can add custom elements like buttons, footer, social media links etc. Guide on cloning the templates.
Cloning the template will also generate a unique template ID
that you will need to send emails with better auth.
Sending emails
Common params for all the email methods:
The email address of the recipient
The template ID of the email template you generated by cloning pre-built better auth templates
The subject of the email, if skipped, a default subject will be used (optional)
The pre-header of the email, if skipped, a default pre-header will be used (optional)
The email provider you want to use to send the email. If you have configured only one email provider while initializing the Shootmail client, you can skip this. The only configured email provider will be used as default.
The sender of the email (optional)
The name of the sender (optional)
The email address of the sender
Methods
Signup verification email
All the common params like subject
, preHeader
, provider
, from
are available to use. Below is the
required params for this method.
The verification URL
OTP verification email
All the common params like subject
, preHeader
, provider
, from
are available to use with this method.
Below is the required params for this method.
The OTP
The type of OTP “sign-in” | “email-verification” | “forget-password”
The validity of OTP in minutes. This is just to display a message to the user in the email.
Password reset email
All the common params like subject
, preHeader
, provider
, from
are available to use with this method.
Below is the required params for this method.
The reset password URL
Change email verification email
All the common params like subject
, preHeader
, provider
, from
are available to use with this method.
Below is the required params for this method.
The verification URL
The new email
Delete account verification email
All the common params like subject
, preHeader
, provider
, from
are available to use with this method.
Below is the required params for this method.
The verification URL
Invite organization member
All the common params like subject
, preHeader
, provider
, from
are available to use with this method.
Below is the required params for this method.
The invite URL
The team name
The email of the inviter
The name of the inviter