Updated on 2024-08-13 GMT+08:00

Template and Variable Specifications

A template consists of fixed text and variables or only fixed text. You can edit template content based on your service requirements and can only send SMSs with approved templates. The variables change according to SMS content.

Apply for several SMS templates in advance according to service requirements and reserve sufficient time for review. Templates can be reviewed only on workdays.

Read the following specifications and mak sure that your SMS templates comply with the common specifications and special specifications of each template type.

Common Specifications

Template Specifications

Format

Each template contains no more than 500 characters.

  • A template cannot contain square brackets. Templates with square brackets may be confused with signatures, causing SMS sending failures.
  • Special characters (¥★^_^&√[]) are not supported. Such special characters may cause garbled characters in SMS messages.

Content

Fixed texts in a template must be able to denote the meaning and application scenario of the SMS. Use as many fixed texts as possible.

  • Unauthorized invitations are not allowed to send, including sign-up, membership, and event invitations.
  • Real estate, game, and education enterprises can use only the verification code SMSs.
  • Do not send SMSs that contain the following information or keywords: stocks, immigration, finance, job interviews, gambling, ballgame betting, lottery, rebates, loans, payment reminders, investments, prizes, one-dollar flash sales, counterfeit goods, medical care, cosmetic surgery, beauty care, clubs, bars, porn, drugs, foot spa, threats, fur, exam assistance, trademark registration, group invitation, QQ invitation, WeChat invitation, selling of personal data, app download links, rebates for positive comments, promotional SMS channels, user attraction, user retention, operator-related content (value-added services, customer service center, China Mobile, China Unicom, China Telecom, China Broadnet, Tencent king cards, group SMSs, and 4G/5G), essay writing services, board and card games, online games, lawsuits, summons, credit blacklists, governments, party, right safeguarding, crude oil futures, precious metals, private equity, comments, studying abroad, international investments, bills of exchange, business and commerce agents, invoice issuance, partner recruiting, registration invitation, driver license annual review, software selling, selling of mobile phones or knockoff devices, delivery confirmation, contraband, virtual currencies, stamps, debt collection, religions, superstitions, COD e-commerce, friend-making, dating, POS machines, bonus point redemption, weddings and funerals, laws, finance, taxes, certification agency, patents, franchised stores, exhibitions, mediation, installment, bonus point clearing, click farming, customer service account, Taobao link copying, zero-dollar shopping, company registration, intellectual property rights, provident/social security fund filing agents, healthcare, elderly care, digital collections, questionnaires, training and lectures, insurance, livestreaming, tobacco, wine, tea, part-time jobs, real estate trading, decoration and building materials, and other illegal content.

An SMS signature is automatically added to a message, so do not add one to a template.

Variable Specifications

Each template can contain a maximum of 20 variables. Continuous variables or full-variable templates are not supported. (If characters not containing spaces exist between variables, the variables are discontinuous.)

Note: If you need to extend the variable length, describe your service scenario with examples and reasons for variable extension and specify the variable to be extended and desired length when applying for an SMS template.

The system supports variables listed in the following table. You can choose a proper variable format and length.

Variable Format

Type

Example Value

Description

${TXT_Digit}

Character

${TXT_20}

Digit indicates the maximum length. The value can be 1 to 20.

Each non-English character is counted as two bytes. Each English letter, digit, or punctuation mark is counted as one byte.

Set this parameter based on the site requirements. Do not set this parameter to a large value.

NOTICE:
  • The variable value cannot contain braces ({ }). Otherwise, template variables may fail to be parsed.
  • The variable value cannot contain single quotation marks ('). Otherwise, the template variable verification fails.

${NUM_Digit}

Digit

${NUM_6}

Digit indicates the maximum length. The value can be 1 to 20. One digit is counted as one character.

When sending an SMS, enter a number ranging from 0 to 9. The number cannot contain other characters, such as hyphens (-).

Set this parameter based on the site requirements. Do not set this parameter to a large value.

${DATE}

Date

${DATE}

The date in an SMS is in yyyy/MM/dd format, for example, 2017/07/16, 2017/7/16, or 2017/7/1.

${TIME}

Time

${TIME}

The system supports the following time formats:

  • HH:mm, for example, 14:30
  • HH:mm:ss, for example, 14:30:30

Specifications for Each Template Type

In addition to the common specifications, each template type has the following specifications:

Category

Variable Specifications

Content Specifications

Verification code template

  • Only one variable is supported for entering the digital verification code.
  • The maximum length of the verification code variable must be less than or equal to 8 digits.

A Chinese Mainland SMS must contain a verification code, registration code, or dynamic code.

Notification template

The link and contact information cannot be sent using variables. Enter the link and contact information using fixed texts in the template.

Marketing promotional information is not allowed.

  • The template specifications may be adjusted in real time based on the carrier's rules. The final template review result prevails.
  • If your violation causes bad influence, serious measures will be taken and your account will be blocked. Strictly comply with the specifications to enhance service security.

Template Review Description

The common issues of all template types are as follows:

Type

Level-1 Issue

Level-2 Issue

Handling Suggestion

Invalid Template Example

Valid Template Example

The application is incorrect.

The signature is incorrect.

Huawei Cloud SMS test and the general signature are selected.

  1. When applying for an SMS template, select the SMS signature that you have applied for.
  2. Select the general signature when more than two signatures of the same type need to use the same template.

-

For more examples, see Sample Template.

The SMS template attribute is inconsistent with the SMS signature attribute.

Keep the SMS template attribute consistent with the SMS signature attribute. (For example, the signature of company A cannot be used to apply for the SMS template of company B's services.)

-

For more examples, see Sample Template.

The SMS type is incorrect.

The verification code type is mistakenly selected for notification SMSs.

Select a proper SMS type based on the SMS content.

-

For more examples, see Sample Template.

The format is incorrect.

Variables are incorrect.

The number of variables is incorrect.

Consecutive variables are not supported. The total number of variables cannot exceed 20.

Reminder: The meeting at ${DATE} ${TIME}${TIME}${NUM_6}${TXT_20} is about to start. Join the conference on time.

Reminder: The conference at ${DATE} - ${TIME} is about to start. Join the conference on time.

The variable value is incorrect.

  1. The values of ${TXT_Digit} and ${NUM_Digit} both range from 1 to 20. Set these parameters based on site requirements.
  2. The verification code uses ${NUM_Digit} as a variable. The value contains a maximum of six digits.

Your verification code is ${NUM_7}. It is valid for 5 minutes. Do not provide this verification code to anyone.

Your verification code is ${NUM_6}. It is valid for 5 minutes. Do not provide this verification code to anyone.

The variable format is incorrect.

The following variable formats are supported by templates:

  • ${TXT_Digit}: characters (text), in bytes. The value ranges from 1 to 20.
  • ${NUM_Digit}: digits, in bytes. The value ranges from 1 to 20.
  • ${DATE}: date, in the format of yyyy/MM/dd.
  • ${TIME}: time, in the format of HH:mm or HH:mm:ss.

Your verification code is ${1}. It is valid for 5 minutes. Do not provide it to anyone.

Your verification code is ${NUM_6}. It is valid for 5 minutes. Do not provide it to anyone.

The signature is duplicate.

The SMS signature is incorrectly added to the template content.

The system automatically adds the signature when sending an SMS. Delete the signature from the template content.

[Signature] Your verification code is ${NUM_6}. It is valid for 5 minutes. Do not provide it to anyone.

Your verification code is ${NUM_6}. It is valid for 5 minutes. Do not provide it to anyone.

The SMS content is incorrect.

The SMS content contains forbidden symbols.

Special characters (¥★^_^&√[]) are not supported.

  1. Delete the symbols that cannot be sent.
  2. If the SMS template contains the symbol [], the SMS may fail to be sent. Delete the symbol.

Reminder: The conference at ${DATE} & ${TIME} is about to start. Join the conference on time.

Reminder: The conference at ${DATE} -${TIME} is about to start. Join the conference on time.

The variable is incorrectly used.

${DATE}${TIME} is not used for time, and ${NUM_Digit} is not used for numbers.

Select variables based on the actual SMS content. Do not randomly use TXT variables.

Reminder: The conference at ${NUM_6} & ${TXT_5} is about to start. Join the conference on time.

Reminder: The conference at ${DATE} -${TIME} is about to start. Join the conference on time.

The SMS content is not clear.

A full variable template contains few fixed texts and many variables. Variable values are too large. Service scenarios cannot be identified.

The full variable template is not supported. You can set variables as required and use as much fixed text as possible so that the meaning and application scenario of the SMS can be understood.

${DATE} ${TIME} - ${TIME} of ${TXT_12}

Reminder: The conference at {DATE}- ${TIME} is about to start. Join the conference on time.

The template lacks mandatory keywords.

A verification code SMS template must contain any of the verification code, registration code, and dynamic code.

Add a required keyword.

${NUM_6} is valid within 5 minutes. Do not provide it to anyone.

Your verification code is ${NUM_6}. It is valid for 5 minutes. Do not provide it to anyone.

The following table lists the special issues of different types of templates:

Type

Level-1 Issue

Level-2 Issue

Handling Suggestion

Invalid Template Example

Valid Template Example

Verification code

The template contains forbidden content.

The verification code template contains marketing content.

Delete the content that is not related to verification code.

Your verification code is ${NUM_6}. It is valid for 5 minutes. Log in to collect your coupons!

Your verification code is ${NUM_6}. It is valid for 5 minutes. Do not provide this verification code to anyone.

The template contains other variables.

There are other long variables in addition to the verification code.

Do not set other content in an SMS as variables. If verification codes are of multiple types, such as registration and password change, you can apply for different templates separately.

Your verification code is ${NUM_6}. It is valid for 5 minutes and is used only for ${TXT_20}.

Your verification code is ${NUM_6}. It is valid for 5 minutes. Do not provide this verification code to anyone.

Notification

Recruitment and interview notifications are not supported.

-

Do not send recruitment and interview notifications.

Dear XX, this is a reminder for the first round of interview on ${DATE} in ${TXT_20}. Please prepare related documents.

For more examples, see Sample Template.

Notifications on games, finance, real estate, and education are not supported.

-

Do not send game, real estate, and financial notifications.

Log in to the XX game to collect rewards.

For more examples, see Sample Template.

Dunning notifications are not supported.

-

Do not send dunning and payment notifications.

Amount due: CNY${NUM_6}. Due date: 8th of this month.

For more examples, see Sample Template.

Notifications contain marketing information.

The first part of the SMS is the notification, and the second part is marketing information.

Do not include marketing information in notification SMSs. You can modify the template content based on the review comments returned by the platform.

You have booked ${NUM_6} tickets. Ticket password: ${NUM_6}. Please arrive in advance. Follow the XX official account to obtain more travel information.

You have booked ${NUM_6} tickets. Ticket password: ${NUM_6}. Please arrive in advance.

SMSs contain other content forbidden by rules.

Notification SMSs contain the content (such as coupons) forbidden by template specifications.

  1. Create a template by following template and variable specifications.
  2. Delete the forbidden content according to the review comments returned by the platform when the template application is rejected.

Follow ${NUM_10} to collect the coupon for the XX product.

For more examples, see Sample Template.