Template Elements
Templates are composed of various text, media, and interactive elements, which can be mixed to build the best user experience. All options are accessible via the Messaging API and WhatsApp Manager. Some functionalities on the 360dialog Template Manager UI are restricted.
Variables
Any template that has one or more variables requires a sample in order to be submitted for review. You can add samples by including the example
property in API request.
You can also include allow_category_change=true
in your API request to avoid template rejection due to miscategorization. Including this parameter and value will allow Meta to assign whatever category they determine to be appropriate.
For example:
Components
Headers
Headers are optional components that appear at the top of template messages. Headers support text, media (images, videos, documents), and locations. Templates are limited to one header component.
Text Headers
Syntax
Properties
Example
Media Headers
Media headers can be an image, video, or a document such as a PDF. The syntax for defining a media header is the same for all media types.
Syntax
Properties
Example
Location Headers
Location headers appear as generic maps at the top of the template and are useful for order tracking, delivery updates, ride hailing pickup/dropoff, locating physical stores, etc. When tapped, the app user's default map app will open and load the specified location.
Location headers can only be used in templates categorized as UTILITY
or MARKETING
. Real-time locations are not supported.
Syntax
Properties
Property values cannot be customized.
Example
Body
Body components are text-only components and are required by all templates. Templates are limited to one body component.
Syntax
Properties
Example
Footer
Footers are optional text-only components that appear immediately after the body component. Templates are limited to one footer component.
Syntax
Properties
Example
Buttons
Buttons are optional interactive components that perform specific actions when tapped. Templates can have a mixture of up to 10 button components total, although there are limits to individual buttons of the same type as well as combination limits.
These limits are described below:
Buttons are defined within a single buttons component object, packed into a single buttons
array. For example, this template uses a phone number button and a URL button:
If you include a button with a variable that is a URL, it must be URL-encoded.
If a template has more than three buttons, two buttons will appear in the delivered message and the remaining buttons will be replaced with a See all options button. Tapping the See all options button reveals the remaining buttons.
Phone number Buttons
Phone number buttons call the specified business phone number when tapped by the app user. Templates are limited to one phone number button.
Syntax
Properties
Example
URL Buttons
URL buttons load the specified URL in the device's default web browser when tapped by the app user. Templates are limited to two URL buttons.
If you include a button with a variable that is a URL, it must be URL-encoded.
Syntax
Properties
Example
Example Request - Limited Time Offer
An example request to create a marketing template with the following components:
an image header with a sample value
a text body with variables and sample values
a text footer
a phone number button
a URL button
SPM Buttons
Single-product message (SPM) buttons are specific, non-customizable buttons that can be mapped to a product in your product catalog. When tapped, they load details about the product, which it pulls from your catalog. Users can then add the product a card and place an order. See Single-Product Message Templates and Product Card Carousel Templates.
Quick Reply Buttons
Quick reply buttons are custom text-only buttons that immediately message you with the specified text string when tapped by the app user. A common use case-case is a button that allows your customer to easily opt-out of any marketing messages.
Templates are limited to 10 quick reply buttons. If using quick reply buttons with other buttons, buttons must be organized into two groups: quick reply buttons and non-quick reply buttons. If grouped incorrectly, the API will return an error indicating an invalid combination.
Examples of valid groupings:
Quick Reply, Quick Reply
Quick Reply, Quick Reply, URL, Phone
URL, Phone, Quick Reply, Quick Reply
Examples of invalid groupings:
Quick Reply, URL, Quick Reply
URL, Quick Reply, URL
When using the Cloud API or On-Premises API to send a template that has multiple quick reply buttons, you can use the index property to designate the order in which buttons appear in the template message.
Syntax
Properties
Example
Example Request - Seasonal Promotion
An example request to create a marketing template with the following components:
a text header with a variable and sample value
a text body with variables and sample values
a text footer
two quick-reply buttons
Copy Code Buttons
Copy code buttons copy a text string (defined when the template is sent in a template message) to the device's clipboard when tapped by the app user. Templates are limited to one copy code button.
Syntax
Properties
Example
OTP Buttons
One-time password (OTP) buttons are a special type of URL button used with authentication templates. See Authentication Templates.
Flows Buttons
Flows buttons are for sending Flows Messages as templates. Templates are limited to one Flows button.
Syntax
Properties
Example
Last updated