Twilio/media
is used to send file attachments, or to send long text via MMS in the US and Canada. As such, the twilio/media
type must contain at least ONE of text or media content. The total size of the text and media attachments must be less than 5MB (16MB for WhatsApp).
If you plan to submit this template to WhatsApp for approval, a valid media sample is required. Static media urls should resolve to publicly hosted media files. Variable media urls should include a valid media URL suffix in the variable declaration.
Only one type of media can be sent per approved variable WhatsApp media template. WhatsApp classifies approved templates into 1 of 3 types of media headers (Image, Video, Document) based on the sample that was submitted. Once the template has been approved another type of media header cannot be sent using the template.
Ex. If a template is approved with an image then a video cannot be sent using the same template.
During a 24-hour user-initiated session, template approval is not required by WhatsApp for twilio/media
templates.
For out of session (business-initiated) media templates, an additional approval step is required during the Beta. In the Media field of the template you create, provide the URL of the publicly hosted file.
If you are using a media template with a variable. Please submit a sample path of a publicly hosted image URL in the variable array. The combined URL must contain the file type. The combined URL must resolve to a publicly hosted file.
Example:
"media": ["https://twilio-cms-prod.s3.amazonaws.com/{{1}}"]
would include a path sample in the variables
definition. "variables": {"1": "images/library-logo-resource2x.width-1000.png"}
After you submit the template for approval to WhatsApp, your template should be approved and ready to send in 1 hour. If your template is still pending after 1 business day, please email messaging-channels-ops@twilio.com with the ContentSid, the template name you submitted to WhatsApp, and your AccountSid. In the email subject please include "[Content API Beta - Media Request]" to ensure timely processing. If the body text of your Media template includes a variable, please also provide a sample message in your email request. For example, if your template states "Hi {{1}}, your order is confirmed", please submit a sample such as "Hi Sam, your order is confirmed."
Twilio/media templates can be sent via WhatsApp for out of session messages with variables. If the template's body starts or ends with a variable or has two variables next to each other, the template will not be approved by WhatsApp without a sample variable. For additional information about variables Using Variables with Content Templates.
MMS, WhatsApp, Facebook Messenger
body:
media:
www.twilio.com/images/{{1}}
. Supported and Accepted media types can be referenced here (MMS) and here (WhatsApp).