SMS templates
Logto provides four different templates for customizing SMS content, which are categorized based on their usage type: Register, SignIn, ForgotPassword, and Generic. It is highly recommended that you use different templates for various use cases, or it could hit rate limit, leading to a temporary outage of your service.
SMS template types and examplesβ
There are some examples just for reference:
usageType | Scenario | Template examples |
---|---|---|
SignIn | Users sign in using their phone number and verify by entering SMS verification code instead of entering a password. | Logto sign-in verification code: {{code}} . Expires in 10 mins. |
Register | Users create an account using their phone number and verify it by entering a verification code sent by Logto to their phone number. | Logto sign-up verification code: {{code}} . Expires in 10 mins. |
ForgotPassword | If users forget their password during login, they can choose to verify their identity using the phone number first to reset password. | Logto password reset verification code: {{code}} . Expires in 10 mins. |
Generic | This template can be used as a general backup option for various scenarios, including testing connector configurations, verifying or linking phone number after sign-in, and so on. | Logto verification code: {{code}} . Expires in 10 mins. |
OrganizationInvitation | Use this template to send users an invitation lin to join the organization. | Logto organization invitation verification code: {{code}} . Expires in 10 mins. |
UserPermissionValidation | During app usage, there may be some high-risk operations or operations with a relatively high risk level that require additional user verification, such as bank transfers, deleting resources in use, and canceling memberships. The UserPermissionValidation template can be used to define the content of the SMS verification code users receive in these situations. | Logto verification code: {{code}} . Expires in 10 mins. |
BindNewIdentifier | When a user modifies their profile, they may bind a phone number to their current account. In this case, the BindNewIdentifier template can be used to customize the content of the verification SMS. | Logto account linking verification code: {{code}} . Expires in 10 mins. |
It's important to understand these parameters:
- The verification code is valid for 10 minutes. We currently do not support customization on the expiry time.
- Logto will replace the
{{code}}
placeholder in the SMS template with a verification code. Therefore, please ensure that the template has a placeholder reserved.
note:
Some countries and regions may not allow sending unapproved content via SMS due to compliance requirements. SMS templates need to be registered and approved by the SMS provider before they can be used. In such cases, the content might be indexed by template ID to the corresponding template.