Quick guide to SMS templates for beginners
An SMS template is standard message content that an enterprise uses to send SMS messages. Before sending verification codes, notification messages, or promotional messages, an enterprise must create and submit an SMS template of the corresponding type. After the template is approved, the enterprise can use it with an SMS signature and recipient phone numbers to send messages. A template can contain fixed content and variables to define the structure, purpose, and variable information of the messages that are sent.
Should you choose a verification code, notification, or promotional template? Which content is suitable for variables? Can you include links and contact information? What else should you check before submission? This topic provides suggestions for common scenarios. For complete specifications and detailed operations, see the links in this topic.
1. Which type of SMS template should I choose?
Choose the template type based on the actual message content and sending scenario.
Business scenario | Recommended template type | Notes |
User registration, login, and identity verification | Verification code | Keep the content focused on the verification code and its purpose. Do not include unrelated notifications, marketing, or advertisements. |
Identity verification before resetting a password or changing important information | Verification code | These are security authentication scenarios. |
Order confirmation and order status changes | Notification | Use only for business notifications. Do not include promotional content. |
Logistics updates and pickup reminders | Notification | The content must relate to the actual logistics service. |
Service activation, price adjustments, and purchase confirmations | Notification | Reassess the template type if you add discounts, promotions, or other marketing information. |
Coupons, discounts, and promotional activities | Promotional | Apply in accordance with the rules for promotional messages. |
Birthday greetings and holiday greetings for members | Promotional | Submit these member-care messages as promotional messages. |
New products, business promotion, and member marketing | Promotional | Comply with the user relationship and sending requirements for promotional messages. |
Pay particular attention to the following:
A verification code message that includes marketing content is no longer solely a verification code message. Verification code templates cannot contain unrelated notifications, marketing, or advertisements.
A notification that includes discounts or promotions is no longer solely a notification. For example, in “Your order has been delivered. Click to claim a coupon,” the second part is promotional content. Notification messages cannot include marketing content.
For promotional messages, consider both the content and the recipients. Marketing content must target members, registered users, and other users who meet the requirements. You cannot send registration invitations, company introductions, or other commercial marketing information to non-members whose membership relationship cannot be verified.
For complete rules, see:
2. Are ready-made templates available before I create a template?
If the Alibaba Cloud Short Message Service console provides complimentary templates that meet your business requirements, you can use them first instead of creating new templates.
Create your own template if existing templates do not meet your requirements.
→ For application instructions, see Apply for an SMS template
3. How do I use template variables?
Which content is suitable for variables?
Only information that changes each time a message is sent is suitable for variables, such as verification codes, order numbers, times, and amounts.
For example:
Your order ${order_no} has been shipped and is expected to arrive on ${date}.
The order number and date can change and can be variables. Keep the other business descriptions fixed.
Do not make large portions of the message body variables merely to increase flexibility.
How should I write variables?
Situation | Recommendation |
Use variables only for information that actually changes | ✓ |
Match variable attributes to the actual content | ✓ |
Include fixed text between multiple variables | ✓ |
Use variables for most of the message body | × |
Place two variables directly next to each other | × |
Use only variables in the entire template | × |
Keep template variables to the necessary minimum. Currently, use no more than three variables per template. The template must also contain fixed content.
Select attributes that match the actual content of each variable. For example, select the time attribute for times and the amount/quantity attribute for amounts. Do not select “Other” for all variables merely for convenience.
Can I pass arbitrary variable values after a template is approved?
No. After a template is approved, the variable values that you pass when sending messages must still comply with the rules for their attributes.
For example, for this template:
Your order amount is ${money} yuan.
${money} should be set to the actual amount, such as:
99
Instead of:
99 yuan
If a value does not meet the variable attribute requirements, the message may fail validation before it is sent.
Verification code templates have separate requirements for the number and format of variables. If you use a verification code template, see Verification code template specifications.
4. Can I include links and contact information in a template?
The supported scope and restrictions depend on the template type, so minimize links, contact information, and other traffic-driving information unless they are essential for your business.
One restriction is clear:
Verification code templates do not support links.
Notification and promotional messages can contain certain links or business contact information when they comply with the rules, but carriers may block them. For example, notification messages support only official business customer service numbers, such as landline, 400, and 95 numbers. Mobile phone numbers and other contact information are not supported. See Notification template specifications
If you need to use a link, also note the following:
Do not make the entire link a variable.
For example, the following is not recommended:
${url}
When permitted by the relevant template specifications, use a fixed main part of the link and variable parameters in allowed positions.
If a template contains links or numbers, pay attention to the traffic-driving information identified by the console, and fill in and verify it as required.
For detailed rules, see the relevant template specifications instead of relying only on experience:
5. What else should I check before submission and after approval?
Quick checks before submission
Item | Quick check |
Template type | Have you selected verification code, notification, or promotional correctly? Does a notification include marketing content? |
Variables | Have you kept only the necessary variables? Do their attributes match the actual content? |
Third-party content | Does the content involve other companies, brands, or businesses? Are the relevant qualifications and authorizations complete? |
Special industries | Does the business involve industries with additional restrictions, such as finance, gaming, social networking, or government and enterprise services? |
Links / contact information | Do they comply with the relevant template specifications? Have you filled in traffic-driving information as required? |
Scenario description | Have you described the actual business scenario and provided complete message and variable examples? |
If you apply for a promotional message, also check the following:
Whether recipients meet the requirements for members, registered users, and other eligible users.
Whether the user relationship or authorization materials meet the requirements.
Whether the unsubscribe method at the end of the template meets the specifications. Currently, promotional messages support only “拒收请回复R” (reply R to opt out). Short Message Service automatically adds this text if it is omitted.
If your business involves special industries such as finance, gaming, or social networking, review the applicable restrictions before you prepare a template. For example, promotional messages explicitly do not support the finance, gaming, and social networking industries.
Three easily overlooked issues after template approval
1. Approval does not guarantee successful sending.
Variable values, links and traffic-driving information, and real-time carrier rules may still affect the final sending result.
2. Pay attention to TemplateCode after you change a template.
To change the content or variables of an approved template, you generally need to apply for a new template or clone a template. When you use the new template, also check the TemplateCode in your business code.
3. The associated signature selected during application is not a permanent binding for sending.
The associated signature selected during application primarily assists the review. After the template and signature are approved, specify TemplateCode and SignName separately when sending messages. You can combine them as needed as long as their usage scenarios match.
Find the right topic when you encounter a problem
My question | Recommended topic |
I do not know whether to choose verification code, notification, or promotional | |
I want to learn how to apply for a template | |
I am unsure about verification code template content or variables | |
I am unsure about links or contact information in notification templates | |
I am unsure about promotional message content, user relationships, or unsubscribe methods | |
My template failed review | |
I want to manage, clone, or delete existing templates |