MessageTemplate Class

Definition

The template object used to create templates.

public class MessageTemplate : System.ClientModel.Primitives.IJsonModel<Azure.Communication.Messages.MessageTemplate>, System.ClientModel.Primitives.IPersistableModel<Azure.Communication.Messages.MessageTemplate>
public class MessageTemplate
type MessageTemplate = class
    interface IJsonModel<MessageTemplate>
    interface IPersistableModel<MessageTemplate>
type MessageTemplate = class
Public Class MessageTemplate
Implements IJsonModel(Of MessageTemplate), IPersistableModel(Of MessageTemplate)
Public Class MessageTemplate
Inheritance
MessageTemplate
Implements

Constructors

MessageTemplate(String, String)

Initializes a new instance of MessageTemplate.

MessageTemplate(String, String, IEnumerable<MessageTemplateValue>, MessageTemplateBindings)

Initializes a new instance of the MessageTemplate class.

Properties

Bindings

The binding object to link values to the template specific locations Please note MessageTemplateBindings is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. The available derived classes include WhatsAppMessageTemplateBindings.

Language

The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter country code, e.g., 'en' or 'en_US'.

Name

Name of the template.

Values

The template values. Please note MessageTemplateValue is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. The available derived classes include MessageTemplateText, MessageTemplateImage, MessageTemplateDocument, MessageTemplateVideo, MessageTemplateLocation and MessageTemplateQuickAction.

Explicit Interface Implementations

IJsonModel<MessageTemplate>.Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

IJsonModel<MessageTemplate>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IPersistableModel<MessageTemplate>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<MessageTemplate>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

IPersistableModel<MessageTemplate>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

Applies to