Apply for an sms template

更新时间:
复制 MD 格式

An sms template defines the content of a message that a user receives, which can include variables and static text. Based on your business needs, you can apply for templates for verification codes, notification messages, or promotional messages. You can send messages only after the template is approved.

Usage notes

  • Before you apply for an sms template, you must first apply for an sms signature and wait for its approval.

  • The prices for sending verification codes, notification messages, and promotional messages are different, except when you use a general prepaid SMS package. For more information, see Billing.

  • You must apply for sms templates one by one in the console or by using an API operation. Batch creation is not supported. To apply for a large number of templates, you can call the CreateSmsTemplate API operation multiple times. An Alibaba Cloud account can apply for a maximum of 100 templates per calendar day. Wait at least 30 seconds between applications.

  • The following table lists the application limits for sms templates:

    Category

    Description

    Application limit

    Official template

    A template becomes an official template when you associate it with an official signature.

    • Short Message Service console: No limit.

    • Calling the CreateSmsTemplate API operation: An Alibaba Cloud account can apply for a maximum of 100 templates per calendar day. Wait at least 30 seconds between applications.

    Complimentary template

    A system-provided template. The template name is followed by image.

    No application is required. The system automatically provides these templates when you activate Short Message Service.

  • Third-party system integration: If you use a built-in sms template from a third-party system, such as an e-signature service or Seeyon OA, you must still apply for the template separately in the Short Message Service console. You cannot directly use the template provided by the third-party system.

  • API operation version: The AddSmsTemplate API operation is obsolete. If calling this API operation returns the isv.INTERFACE_OFFLINE error code, use the CreateSmsTemplate API operation instead.

  • SDK version notes: The alibabacloud-dysmsapi20170525 SDK v2.0.24 or later no longer includes the CreateSmsTemplateRequest class. Please refer to the latest API documentation to use the new request method.

  • Query template details: To query the details of a template, use the GetSmsTemplate API operation, not QuerySmsTemplateList.

Procedure

This section describes how to apply for an sms template in the console. You can also apply for an sms template by calling the CreateSmsTemplate API operation.

Chinese mainland

  1. Log in to the Short Message Service console. In the left-side navigation pane, choose Chinese mainland messages > Templates.

  2. On the Templates page, click Create Template. Follow the on-screen instructions to select a Template type.

    • Verification code: Sends a message containing a verification code. For specific requirements, see Verification code template guidelines.

    • Notification message: Sends general notifications, such as order information and logistics updates, to registered users. For specific requirements, see Notification message template guidelines.

    • Promotional message: Sends promotional content, such as sales alerts, business promotions, and customer care messages, to registered users. For specific requirements, see Promotional message template guidelines.

      Note
      • Only enterprise-verified users can apply for promotional message templates. For more information about the differences in permissions between individual and enterprise users, see Usage notes.

      • To prevent negative impacts from unsolicited promotional messages, send them only after obtaining member consent.

  3. Configure the template information and parameters.

    • Associated signature: Select an sms signature that has been approved.

      Note
      • The template and its associated signature are submitted to carriers for review. Associating an approved signature can improve the success rate of carrier real-name signature registration.

      • The associated signature that you select during template application is used only to help reviewers verify the use case and is not a mandatory binding for sending messages. sms templates and signatures are not tightly coupled. When you send messages, you can freely combine any approved template and signature based on your needs. In an API call, you specify the signature with the SignName parameter and the template with the TemplateCode parameter. These parameters are passed independently. You can combine any approved template and signature as long as they are appropriate for the use case.

      • Changing the associated signature does not require reapplying for the template and does not change the template code.

    • Template modification limits: You cannot directly modify the content of an approved template. To change the template content, variable names, variable attributes, or variable length limits, you must apply for a new template or use the Clone feature. After the new template is approved, the system generates a new template code, and the original template code cannot be reused. You must update your application code with the new TemplateCode. Cloning a template also generates a new template code.

    • Template name: Enter a name for the template. The template name is used only to manage and differentiate your templates and does not appear in the message content.

    • Template content: Enter the message content that complies with the sms template guidelines and matches your use case.

      You can click Recommended Templates to use a sample template, or use the SMS Template AI Assistant to generate template content. Using a sample template can speed up the review process and increase the approval rate.

      Note
      • The content of a verification code template must contain one of the following: "verification code," "registration code," "check code," or "dynamic code (dynamic password)."

      • A promotional message template must include an unsubscribe option at the end. The standard instruction is "Reply R to unsubscribe."

      To use a variable, use the format ${variable_name} in the template. You can also type / to quickly add a variable.

      • The length of a single variable is limited to 1 to 35 characters.

      • A variable can appear only once in a template.

      • Combined variables, adjacent variables, and templates that consist only of variables are not supported.

      • Use no more than three variables in a template. If you use more than three variables, the template may fail carrier registration if carrier policies change in the future.

      Verification code variables

      • Digits only (Recommended): The variable length is limited to 4 to 6 characters.

      • Digits and letters, or letters only: The variable length is limited to 4 to 6 characters.

      If you need to use two variables in a verification code message, you must select a sample template from Recommended Templates. Custom templates with two variables are not supported.

      Notification message variables

      Variable attribute

      Variable name

      Variable specifications

      Time

      Custom. We recommend setting a name based on the date or time type.

      Examples: ${time}, ${date}, ${day}, ${year}, ${month}.

      • Must conform to standard system date/time formats. Dates must use the Gregorian calendar. Special symbols such as underscores are not supported.

      • Date, for example: YYYYMMDD, YYYY-MM-DD, YYYY/MM/DD, or YYYYyearMMmonthDDday

      • Time, for example: hh:mm:ss or hh:mm

      • Date + time period, for example: morning, afternoon, evening

      • Date + time combination, for example: YYYYMMDDhh:mm:ss

      Note

      Passing parameters in JSON array format is not supported.

      Amount/Quantity

      Custom. We recommend using a meaningful name.

      Example: ${money}.

      • Supports combinations of numbers and decimal points.

      • Currency symbols such as ¥, $, yuan, and USD are not supported.

      • Common quantity units such as 'pieces' or 'minutes' are not supported.

      User Nickname

      Custom. We recommend using the account name from a live website or app.

      Example: ${user_nick}.

      • Maximum length of 20 characters.

      • Only English letters, numbers, and simplified Chinese are supported.

      • Supports common half-width English characters, such as ()@#!$%^&*-_=+{}[];:<'>,./?".

      • All full-width Chinese characters and spaces are not supported.

      • Special characters and emoji are not supported.

      • QQ numbers and WeChat IDs are not supported.

      Personal Name

      Custom. The legal name registered in household records.

      Example: ${name}.

      Limited to 2–5 simplified Chinese characters.

      Note

      If an actual name exceeds this limit, you can select another suitable variable attribute based on the specifications and your use case. In the use case description, provide a complete message example for review.

      Company/Organization Name

      Custom. We recommend using the company or organization name registered with the Administration for Market Regulation.

      Example: ${unit_name}.

      • Maximum length of 20 characters.

      • Only Chinese characters and Chinese parentheses are supported.

      • English is not supported.

      Address

      Custom. We recommend using the location of a home, company, or other organization.

      Example: ${address}.

      • Only simplified Chinese, numbers, English letters, and common characters (standard keyboard characters) are supported.

      • QQ numbers and WeChat IDs are not supported.

      • Maximum length of 30 characters.

      License Plate Number

      Custom. We recommend using the license plate number for standard or common special-purpose vehicles.

      Examples: ${code}, ${license_plate_number}.

      • Abbreviation for a province, municipality, or autonomous region, or a military identifier (KA, WJ).

      • Supports a combination of 4 to 6 digits, English letters, and 1 to 2 Chinese characters for <special vehicle identifiers (such as Police or Emergency)>. The total length cannot exceed 10 characters. English letters must be in uppercase.

      • QQ numbers and WeChat IDs are not supported.

      Tracking Number

      Custom. We recommend using the order number for logistics or express delivery.

      Examples: ${code}, ${order}, ${tracking_number}.

      Note

      Select a suitable variable attribute based on the variable specifications and your use case. For example, for a JD.com tracking number like JDVC**********7, you can select the Other Numbers attribute and provide a complete message example in the use case description. Our reviewers will evaluate it.

      • Supports 8–16 digits.

      • Supports a combination of 1–3 English letters and 5–16 digits.

      • QQ numbers and WeChat IDs are not supported.

      Pickup Code

      Custom. A confirmation code used for retrieving temporarily stored items like packages.

      Examples: ${code}, ${order}, ${pick_up_code}.

      Supports a combination of 4–8 digits, hyphens, and underscores.

      Other Numbers

      Custom.

      Examples: ${code}, ${order}, ${order_sn}, ${password}.

      • Supports a combination of numbers and letters, with a maximum length of 35 characters. Examples: verification code, password, order number.

      • QQ numbers and WeChat IDs are not supported.

      Phone Number

      Custom.

      Examples: ${phone}, ${telephone}.

      • Standard landline numbers in Chinese mainland. Supports 5–13 digits and hyphens, with a maximum length of 15 characters.

      • A template can contain a maximum of two phone numbers. The numbers can be in the variable or the fixed text, but not both. For example, you cannot use a phone number variable if the fixed text also contains a phone number.

      • Fill in the number type and number fields according to your company's actual qualifications. Otherwise, the review will fail.

      Examples: 0571-82123***, 400-123-1234, 10086, 95679

      URL parameter

      A variable appended to a URL to access a specific web address. You must comply with the URL specifications.

      Note

      If the length limit does not meet your business needs, we recommend selecting the Other (such as name, account, and address) variable attribute. Provide a complete message example in the use case description and describe your use case in detail. Our reviewers will evaluate it comprehensively.

      • A template can contain a maximum of one URL.

      • Variables cannot contain IP addresses or URLs.

      • The variable can be up to 8 characters long, must start with a letter, and can contain letters and numbers.

      • Only combinations of a domain name or official website URL and a variable are supported.

        Correct example: aliyun.com/${code}
      • URLs consisting entirely of variables are not supported.

      • QQ numbers and WeChat IDs are not supported.

      • URLs that link to documents are not supported.

      Email Address

      Custom.

      Example: ${email_address}.

      • A standard email address for sending and receiving information, consisting of a username, the @ symbol, and a domain name.

      • Must start with a letter or number, and supports combinations of English letters, numbers, and underscores. Must include the @ symbol.

      • Limited to 7–30 characters in length.

      Other

      (such as name, account, and address)

      Custom. We recommend setting a meaningful variable name based on the variable type.

      Can be set to a company, product, address, name, content, account, member name, etc.

      Note
      • After selecting the Other (such as name, account, and address) variable attribute, we recommend providing a complete message example in the use case description. Include the parameter values for the variable, describe your use case in detail, and explain why you chose this attribute. Our reviewers will evaluate it comprehensively. If you have special requirements, include your contact information in the use case description.

      • Test templates (templates associated with a test signature) do not support the 'Other' variable attribute.

      • Not allowed for QQ numbers, WeChat IDs (official accounts), mobile phone numbers, websites, landline numbers, mini programs, apps, or URLs.

      • Maximum length of 35 characters.

      Promotional message variables

      Variable attribute

      Variable name

      Variable specification

      User nickname

      Custom. We recommend using account names from your live websites or apps.

      Example: ${user_nick}

      • Maximum length of 20 characters.

      • Only English letters, numbers, and simplified Chinese are supported.

      • Supports common half-width English characters, such as ()@#!$%^&*-_=+{}[];:<'>,./?".

      • All full-width Chinese characters and spaces are not supported.

      • Special characters and emoji are not supported.

      • QQ numbers and WeChat IDs are not supported.

      Personal name

      Custom. We recommend using the individual's registered name.

      Example: ${name}

      Limited to 2 to 5 simplified Chinese characters.

      Quantity/amount

      Custom. We recommend using a meaningful variable name.

      Example: ${money}

      • Supports a combination of numbers and a decimal point.

      • Do not include currency symbols (such as ¥ or $) or units (such as yuan or dollar).

      • Do not include units of quantity, such as items or minutes.

      Date/time

      Custom. We recommend setting the name based on the time type.

      Examples: ${time}, ${date}, ${day}, ${year}, ${month}

      • Must use a standard Gregorian calendar date/time format. Special characters, such as underscores, are not supported.

      • Date examples: YYYYMMDD, YYYY-MM-DD, YYYY/MM/DD, YYYYyearMMmonthDDday

      • Time examples: hh:mm:ss, hh:mm, hhhourmmminute, hhhourmm

      • Period of day examples: morning, afternoon, evening

      • A date and time combination, such as YYYYMMDDhh:mm:ss

      Note

      Passing parameters in JSON array format is not supported.

      Link parameter

      A variable at the end of a URL that points to a specific webpage. You must follow the Link specifications.

      • A template can contain a maximum of one URL.

      • Variables cannot contain IP addresses or URLs.

      • The variable can be up to 8 characters long, must start with a letter, and can contain letters and numbers.

      • Only combinations of a domain name or official website URL and a variable are supported.

        Correct example: aliyun.com/${code}
      • URLs consisting entirely of variables are not supported.

      • QQ numbers and WeChat IDs are not supported.

      • URLs that link to documents are not supported.

      TemplateRule parameter for API

      When you call the CreateSmsTemplate API operation to apply for a template that contains variables, you must pass the TemplateRule field to specify the variable attributes. Otherwise, the API returns the "Template variable attribute is empty" error. TemplateRule is a JSON-formatted string where the key is the variable name and the value is the variable attribute code. For example:

      {"username": "other_number2"}
      Note
      • You cannot modify a variable attribute after you select it. If you pass a variable value that does not comply with the selected attribute's specifications (for example, passing English content for an "Enterprise/organization name" variable), the message fails to send and returns the isv.TEMPLATE_PARAMS_ILLEGAL error. In this case, you must reapply for the template and select the correct variable attribute, such as "Other".

      • The key for a link parameter variable cannot exceed 8 characters in length.

    • Variable information: Select the correct variable attribute for the variables that you have entered.

      • When you select Phone number for the Variable attribute, you must provide the number type and the specific number in the Redirection information form.

      • When you select Link parameter for the Variable attribute, if the template content includes a link, include the link address in the sms template content. If the link includes a variable, use a concatenated address such as www.aliyun.com/${link_args}.

    • Redirection information : The system identifies numbers and links in the template content as redirection information. You must provide additional details.

      Note

      The following rules apply to redirection information. Violating these rules affects your template review result or causes message delivery to fail due to carrier interception. To reduce the risk of delivery failure, avoid including this information in your sms templates:

      • Each template can contain a maximum of two contact numbers. All numbers must be provided either entirely through variables or entirely within the static text content.

      • Each template can contain a maximum of one redirection link. The link must be provided in the static text content and cannot be passed in a variable.

      • Dialable number: The system identifies a dialable number in the template content. Confirm whether the identification is correct. If it is not a dialable number, you can click Set as non-redirection information.

        • Enter the Number type and Number based on your use case, and provide the Enterprise or public institution name and unified social credit code.

      • Clickable link: The system identifies a redirection link in the template content. Check if the Link type and Domain name are correctly identified. If it is not a clickable link, you can click Set as non-redirection information.

        To obtain a screenshot of your ICP filing, go to the MIIT service platform, query your ICP filing, and go to the details page. The screenshot must include the full URL. For your search, select Website as the filing type. Both the ICP filing body information and ICP filing service information must be complete and clear. The screenshot can be in JPG, PNG, JPEG, or BMP format, with a file size of no more than 5 MB.

        • If you confirm that the Link type is Domain name link and the information is correct, you must upload the ICP filing screenshot according to the specifications.

          For example, for aliyun.com, search for the domain name in the MIIT ICP/IP Address/Domain Name Information Filing Management System (beian.miit.gov.cn). Select Website as the filing type. The search results page must completely display the ICP filing body information, including the ICP filing or license number and the entity name, and the ICP filing service information, including the website domain name. Ensure that the full URL is visible in the browser's address bar. Upload a complete screenshot of this page.

    • Use case description: Describe your SMS use case or provide a link to your online business. Also, provide a complete sms example with variable values filled in.

      • A detailed use case description helps reviewers understand your business scenario, which can speed up the review and increase the approval rate.

      • You can provide the parameter values for the variables and describe the use case and the reason for choosing a particular variable attribute in detail.

      • You can provide a link to your business website, a filed domain name, or a download link from an app market.

      • For login scenarios, you can provide a test account and password.

      • Variable attribute is "Other" or involves special characters (for example, a password with special characters): In the use case description, provide a complete SMS example, the parameter values for the variables, and the reason for choosing this attribute.

      • Business content might be misidentified by the system (for example, involving sensitive words such as "last will" or "legal rights"): Provide detailed business screenshots and text descriptions to assist reviewers in their manual evaluation.

    • More information: Upload supplementary business proof documents or screenshots to help reviewers understand your business details.

      If you are applying for a promotional message template: To avoid adverse effects from unauthorized promotional messages, send them only after you obtain consent from your members. Therefore, you need to upload screenshots of your privacy policy and your member management system. For material specifications, see Specifications for uploading user authorization materials.

      • Privacy policy screenshot: A screenshot of the privacy authorization agreement between your app or website and your members, including but not limited to content related to customer notifications and unsubscribing from promotional messages.

      • Member management system screenshot: A screenshot of your member management system to ensure that you are sending promotional messages to your members.

  1. Click AI Check and Submit. The template enters an intelligent detection process.

    • If the AI check passes, follow the prompt to submit the template. After submission, the template is created automatically without entering the manual review process.

    • If the AI check fails, correct the template based on the provided reason and resubmit.

    • If the AI cannot make a definitive judgment, the system automatically escalates the template to a reviewer for manual evaluation. You can check the review progress in the template list.

    Troubleshooting submission issues

    If you encounter an issue when you submit a template, refer to the following troubleshooting guide:

    Issue

    Troubleshooting

    No response after you click AI Check and Submit.

    Check whether any required checkboxes are not selected or any required fields are not filled in.

    Failed to submit a verification code template.

    The verification code variable in a verification code template must use the standard format ${code}. Missing braces will cause the submission to fail. Check the variable format.

    No record appears in the backend after you submit a cloned template.

    Check if the template content contains a hyphen (-) between numbers, such as 400-xxx-xxxx. Remove the hyphen and try again.

    A RAM user receives an "unauthorized" error.

    The Alibaba Cloud account holder must grant the AliyunDysmsFullAccess permission to the RAM user.

International

Note
  • Only enterprise-verified users can apply for international sms templates.

  • Templates for Chinese mainland messages and international messages are not interchangeable. Apply for templates based on your business use case.

  • For messages sent to the United States or Canada, you must provide a 10DLC. The carrier provides a SenderID after registration.

  • For messages sent to Singapore, you must register a SenderID.

  1. Log in to the Short Message Service console.
  2. In the left-side navigation pane, click International messages > Templates.

  3. On the Templates page, click Create Template. Follow the on-screen instructions and the sms template guidelines to fill in the template information. The page includes fields such as Template type (Verification Code, Notification Message, Promotional Message), Template name, Template content (supports the variable format ${name}; variable length limit: 1 to 32 characters for mixed letters and digits, 1 to 20 characters for others), and Application description. After configuring the fields, click Add.

  4. Click Add. The template enters the review process.

Template review

Alibaba Cloud typically reviews submitted templates within two hours. Review hours are from 9:00 to 21:00, Monday to Sunday. Reviews are postponed during statutory holidays.

Due to the special nature of government and enterprise clients, all applications involving government, prosecution, and law enforcement agencies require a landline phone number for verification. Alibaba Cloud completes the review within two business days. If the review is not completed after several business days, please verify that the provided landline number is correct.

Note

You can activate the dedicated DingTalk group for Short Message Service to view sms template review notifications and configure alert notifications.

FAQ

Post-approval template issues

The "Filed for record and pending verification" status indicates that the carrier is automatically verifying the template. This process is triggered automatically based on sending volume and success rate, and is independent of the Alibaba Cloud review status.

  • Send messages in small, frequent batches to trigger the carrier filing process. If the sending results meet your expectations, you can use the template in production without waiting for the filing to complete.

  • The carrier filing process cannot be manually accelerated, and a specific completion time cannot be guaranteed.

  • If the template content includes a link or contact information, it is considered at high risk for interception. Even if approved by Alibaba Cloud, the carrier may still intercept the message, causing it to fail. We recommend that you provide a sample link with complete parameters and business screenshots in the use case description to assist the carrier's evaluation, and try to avoid high-risk content in the template.

  • The filing process must be re-triggered each time a new link is used.

Import, migration, and custom codes

  • Batch import/migration: You cannot batch import, migrate, or transfer templates between accounts. To use the same template in a new account, you must re-submit each application.

  • Custom template code: The template code is generated automatically by the system and cannot be customized, for example, changed to a 6-digit number. You also cannot set the template code to be the same as the template name.

  • Template name purpose: The template name is for internal management and differentiation only. It does not affect the message content and is limited to 30 characters.

  • Multiple message types: Messages with different content, such as balance reminders and data pushes, require separate, independent templates. You cannot reuse the same template for different content.

Signature unavailable during template application

  • Signature unavailable: Try deleting the signature and then applying for the template again to see if the issue is resolved.

  • Account has a violation record: If your account has a violation record, you may be blocked from applying for templates. The specific reason is not disclosed due to security policies. Check the status of your account and signature in the console based on the on-screen prompts.

Related topics