OTP message template

更新时间:
复制 MD 格式

Verification code text messages provide security authentication for scenarios such as logon and registration. When you request a verification code template, you must follow the content and variable rules.

Important

If the content you send involves illegal activities or regulatory violations that result in regulatory investigations, user complaints, or negative public opinion, Alibaba Cloud Communications has the right to abort or stop providing services to you, take measures such as permanent account suspension, and deduct funds from your order or account as liquidated damages, in accordance with Article 5 of the Service Agreement. If these funds are insufficient to cover the loss incurred by Alibaba Cloud, Alibaba Cloud has the right to seek further compensation from you. Please strictly adhere to all applicable regulations, strengthen your own business security, and send text messages responsibly.

Quick links: Template rules | Variable rules | Examples

Template rules

When you write the content for a verification code template, follow these rules for content, format, and links:

Category

Specifications

Content rules

An SMS template must clearly state the message content and reflect its actual sending scenario.

  • Must include the following content:

    • Templates for verification codes sent to mainland China must include one of the following terms: "verification code", "registration code", "check code", or "dynamic code (dynamic password)".

    • Must specify one of the following: the platform, the purpose, or the expiration time.

  • The following content is prohibited:

    • Verification code templates cannot contain notifications, marketing content, advertisements, or unsubscribe instructions. The template cannot end with Reply R to unsubscribe.

    • Verification code text messages cannot contain any contact information, such as phone numbers, QQ, WeChat, Douyin, DingTalk, Wangwang, Xianyu, Xiaohongshu, or email addresses.

    • Signatures intended for third-party use cannot be used to request finance-related SMS templates.

  • If the template content mentions a third party, select the corresponding third-party qualification and signature during the request.

Format rules

  • The template content must be between 1 and 500 characters long, including variables. Rules for calculating text message length

  • The SMS signature is placed in 【】 before the template content. To avoid confusion, do not use 【】 anywhere in the template content. Do not use [ ] at the beginning or end of the template content.

  • The template supports simplified Chinese characters, English letters, numbers, and standard symbols. Traditional Chinese characters and special symbols, such as body# ""''[] m² • (1)★*->, are not supported.

  • Do not use typos, character variants, non-standard characters, obfuscating symbols, or unconventional expressions, such as using homophones to bypass filters.

Link rules

Verification code templates do not support links.

Restricted services for template requests

  • Do not include content that is illegal, non-compliant, or infringes on the rights of others.

  • Do not send text messages that involve: pornography, gambling, drugs, party and government affairs, betting, sports betting, lotteries, violence, intimidation, smuggling, card and board games, adult products, selling personal information, contraband, door-to-door debt collection, score guessing, crowdfunding, charitable fundraising, religion, superstition (such as fortune-telling, divination, and feng shui), stocks, private equity, crude oil futures, virtual currency, seal carving, counterfeit goods, tobacco and alcohol, issuing invoices on behalf of others, agent-based registration, handling certificate applications on behalf of others, handling annual inspections on behalf of others, agent-based bookkeeping, invitations to join groups, invitations to add QQ or WeChat contacts, invitations to add customer service contacts, replies to confirm receipt of goods, carrier-related content (such as value-added services, business halls, China Mobile, China Unicom, China Telecom, broadcasting and television, King Card, bulk SMS, and 4G/5G), ghostwriting for papers and publications, brushing, completing tasks for rewards, empty package websites, digital collectibles, device rental, legal rights protection, mediation, trademark registration, studying abroad, immigration, loans, debt collection, increasing credit card limits, investment and wealth management, prize notifications, sweepstakes, one-yuan prize grabs, one-yuan flash sales, one-yuan cloud shopping, Class II e-commerce, Taobao commands, zero-yuan purchases, cosmetic surgery, medical aesthetics, fur products, cash back and rebates, funeral services, requests for positive reviews, points redemption, points collection, vocational training, questionnaires, decoration (including building materials and furniture), POS machines, in-home massage services, part-time jobs, app download or promotion links, game promotions, dating service promotions, financial promotions (such as bank promotions, insurance promotions, loans, and installments), exhibition promotions, recruitment promotions, enrollment promotions, data ranking, customer acquisition and lead generation, SEO keyword searches, agent-based promotions (such as intellectual property, patents, and software copyrights), real estate promotions, registration invitations, bidding promotions, franchise promotions, user acquisition, or user recall.

Note

SMS template rules may be adjusted at any time based on requirements from the Ministry of Industry and Information Technology (MIIT) and carriers. The final review result is definitive.

Sample template content

Enter the exact content of the text message you want to send. Use ${variable_name} as a placeholder for variables. You can customize variable names, but they must reflect the purpose of each variable.

Application Scenario

Sample template

Logon/Verification

  • Your verification code is ${code}. This code is valid for 5 minutes. Do not share it with others.

  • Verification code: ${code}. You are logging on. If this was not you, do not share the code.

Registration

  • You are registering with a mobile number. Your verification code is ${code} and is valid for 5 minutes.

  • Dear user, your dynamic password for member registration is ${code}. Do not share it with others.

  • Your registration code is ${code}. If this was not you, ignore this message.

  • Your check code is ${code}. You are registering as a member. Thank you for your support.

Reset password

Your dynamic code is ${code}. You are resetting your password. If this was not you, ignore this message.

Change information

The verification code is ${code}. You are trying to change important information. Keep your account information secure.

You can also use the console to image generate template content with one click or image view more sample templates. Using these sample templates increases the approval rate.

Variable rules

Verification code templates support only single-variable and double-variable templates. Multi-variable templates are not supported.

  • Single-variable templates: You can create custom single-variable templates.

    Variable property

    Variable name

    Variable rule

    Numbers only

    Custom.

    Example: ${code}, ${time}

    Single variable, 4 to 6 digits long.

    Combination of numbers and letters or letters only

    Custom.

    Example: ${code}

    Single variable, 4 to 6 characters long.

  • Double-variable templates: You cannot customize or modify them. When you request a verification code template, click Recommended Templates and select a double-variable template.

    image

Submit for review

Log on to the Template Management page in the console to request an SMS template.

Review time: After you submit an SMS template, the review is typically completed within 2 hours. For requests that involve government agencies or enterprises, you must provide a landline number for verification. Alibaba Cloud completes the review for these requests within two business days. If your template is not reviewed after several business days, check whether the landline number you provided is correct.

Review hours: 9:00 to 21:00, Monday to Sunday. Reviews are postponed during public holidays.

Note

Common reasons for review failure

The following table lists common reasons why verification code templates are rejected and the suggested actions.

Category

Rejection reason

Suggested action

Content is vague or cannot be verified

The template does not reflect the business content and its purpose is unclear.

Use actual business content for testing.

Note

If the template has no business content and is only for testing, you can request one of the following templates:

  • Hello, your password has been reset to ${password}. Please log on and change your password promptly.

  • This is a test message.

The template's application scenario is unclear.

In the scenario description, provide the business scenario where the text message is used or an online link to your business, such as your app, official account, or mini program. Also, provide a complete message sample with the variables populated. For logon scenarios, you can provide a test account and password.

The app, official account, or mini program was not found in the app marketplace.

In the scenario description, provide the correct link to your scenario or a link to your business in any app marketplace. If the product is not yet online, you cannot request a template.

Template content or format does not meet the rules

The verification code SMS template includes unsubscribe instructions.

Remove the unsubscribe instructions and resubmit.

The verification code SMS template contains multiple variables.

Remove the extra variables and resubmit. Verification code templates support only one or two variables. Double-variable templates cannot be customized. The variable can contain only 4 to 6 digits or letters.

Example: Verification code: ${code}.

The verification code SMS template contains irrelevant content.

Remove the content that is not related to the verification code from the template.

The verification code keyword is missing.

Check the template content. The template must include one of the following keywords: 'verification code', 'registration code', 'check code', or 'dynamic code' (dynamic password).

The notification SMS template includes promotional content.

Remove the promotional content and resubmit, or request a promotional SMS template.

The template contains:

  • Typos.

  • Character variants.

  • Traditional Chinese characters.

  • Special symbols.

  • Square brackets 【】.

  • Correct any typos, character variants, non-standard characters, or interfering symbols.

  • Convert Traditional Chinese characters to Simplified Chinese or English.

  • Remove special symbols, such as # 『』「」〖〗 m² • ①.

  • Do not use 【】 anywhere in the template content. Do not use [] at the beginning or end of the template content because the system treats them as signatures. Use < > instead.

The content involves finance, dating, religion, games, or similar topics.

  • For businesses related to dating or games, only verification code text messages are supported. You must request a verification code template.

  • You cannot request finance-related SMS templates for signatures that are intended for third-party use.

  • Promotional content related to finance and religion is prohibited.

The content involves a third party.

If you send text messages on behalf of a third party, you must submit the third party's corporate certificates and a letter of authorization. In the Associated Signature section, select an existing signature that corresponds to the submitted documents, or request a new signature with the relevant documents.

Variable does not meet the rules

The variable content is vague.

We recommend that you clarify the parameter description.

Example: A ${content} meeting will be held at ${place} on ${time}. Please attend on time.

The variable format is incorrect.

Correct the format and resubmit. The variable rules are as follows:

  • The variable name cannot be empty.

  • Combined variables cannot be adjacent.

  • The variable format is ${code}, with the $ symbol outside the curly braces { }.

  • The variable name cannot be email, mobile, id, nick, site, ip, or similar reserved words.

  • The first character of a variable name must be a letter. The name can only contain letters, numbers, and underscores, and it cannot be purely numeric.

The variable property is selected incorrectly.

Select the appropriate variable property based on your business scenario.

Incorrect template type

The selected template type does not meet the requirements.

Request a verification code, notification, or promotional SMS template based on your business scenario. For more information about specific scenarios, see Scenarios.

References

  • For more information about how to request an SMS template, see Request an SMS template.

  • For more information about the rules for calculating SMS content length and the limits on sending frequency, see SMS sending rules.

  • For answers to common questions about SMS templates, see the SMS template FAQ.