Interface WhatsAppTemplateMessageBuilder
- All Known Implementing Classes:
WhatsAppTemplateMessageBuilderImpl
public interface WhatsAppTemplateMessageBuilder
- Author:
- Filip Hrisafov, Anatolii Balakiriev
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
WhatsAppTemplateMessageBuilder.ButtonComponentBuilder
static interface
WhatsAppTemplateMessageBuilder.ComponentBuilder
-
Method Summary
Modifier and Type Method Description WhatsAppTemplateMessageBuilder
addTemplateTextParameter(java.lang.String parameter)
Add a positional text parameter to the body.WhatsAppTemplateMessageBuilder
addTemplateTextParameters(java.util.Collection<java.lang.String> parameters)
Add positional text parameters to the body.WhatsAppTemplateMessageBuilder.ComponentBuilder
body()
Initiates creation of the body.WhatsAppTemplateMessageBuilder
businessAccountId(java.lang.String businessAccountId)
The id of the business account that should be used when sending out the message.WhatsAppTemplateMessageBuilder.ButtonComponentBuilder
button()
Initiates creation of the button.WhatsAppTemplateMessageBuilder
externalUserId(java.lang.String externalUserId)
The id of the recipient of the message.WhatsAppTemplateMessageBuilder.ComponentBuilder
footer()
Initiates creation of the footer.WhatsAppTemplateMessageBuilder.ComponentBuilder
header()
Initiates creation of the header.WhatsAppTemplateMessageBuilder
language(java.lang.String language)
The language of the template that should be used.WhatsAppTemplateMessageBuilder
messageId(java.lang.String messageId)
The id of the reference message within the Engage system.void
send()
Perform the send of the template message.WhatsAppTemplateMessageBuilder
templateId(java.lang.String templateId)
The id of the template that is registered on the WhatsApp sideWhatsAppTemplateMessageBuilder
timeToLive(java.time.Duration timeToLive)
Time To Live (TTL) duration.
-
Method Details
-
timeToLive
Time To Live (TTL) duration. -
templateId
The id of the template that is registered on the WhatsApp side -
language
The language of the template that should be used. -
addTemplateTextParameter
Add a positional text parameter to the body.Short circuit for calling
body()
, thenWhatsAppTemplateMessageBuilder.ComponentBuilder.addTextParameter(String)
and thenWhatsAppTemplateMessageBuilder.ComponentBuilder.buildComponent()
Note: The parameter must be added in the correct order according to the template message.
-
addTemplateTextParameters
WhatsAppTemplateMessageBuilder addTemplateTextParameters(java.util.Collection<java.lang.String> parameters)Add positional text parameters to the body.Short circuit for calling
body()
, thenWhatsAppTemplateMessageBuilder.ComponentBuilder.addTextParameter(String)
and thenWhatsAppTemplateMessageBuilder.ComponentBuilder.buildComponent()
Note: The parameters must be added in the correct order according to the template message.
-
externalUserId
The id of the recipient of the message. This is the id of the user within the WhatsApp system. -
businessAccountId
The id of the business account that should be used when sending out the message. -
messageId
The id of the reference message within the Engage system. It is used in order to correlate the WhatsApp message and the Engage message. -
send
void send()Perform the send of the template message. -
header
Initiates creation of the header. After you are done building this component - callWhatsAppTemplateMessageBuilder.ComponentBuilder.buildComponent()
method to build and add it to the parent builder.- Returns:
- header-specific builder.
-
body
Initiates creation of the body. After you are done building this component - callWhatsAppTemplateMessageBuilder.ComponentBuilder.buildComponent()
method to build and add it to the parent builder.- Returns:
- body-specific builder.
-
footer
Initiates creation of the footer. After you are done building this component - callWhatsAppTemplateMessageBuilder.ComponentBuilder.buildComponent()
method to build and add it to the parent builder.- Returns:
- footer-specific builder.
-
button
Initiates creation of the button. After you are done building this component - callWhatsAppTemplateMessageBuilder.ComponentBuilder.buildComponent()
method to build and add it to the parent builder.- Returns:
- button-specific builder.
-