Class WhatsAppTemplateMessageBuilderImpl
java.lang.Object
com.flowable.engage.external.system.whatsapp.WhatsAppTemplateMessageBuilderImpl
- All Implemented Interfaces:
WhatsAppTemplateMessageBuilder
public class WhatsAppTemplateMessageBuilderImpl extends java.lang.Object implements WhatsAppTemplateMessageBuilder
- Author:
- Filip Hrisafov, Anatolii Balakiriev
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WhatsAppTemplateMessageBuilderImpl.ButtonComponentBuilderImpl
static class
WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl
protected static class
WhatsAppTemplateMessageBuilderImpl.Type
Nested classes/interfaces inherited from interface com.flowable.engage.external.system.whatsapp.api.WhatsAppTemplateMessageBuilder
WhatsAppTemplateMessageBuilder.ButtonComponentBuilder, WhatsAppTemplateMessageBuilder.ComponentBuilder
-
Field Summary
Fields Modifier and Type Field Description protected WhatsAppOutboundTemplateMessageDto
templateMessage
protected WhatsAppJmsExternalConversationSystemAdapter
whatsAppJmsExternalConversationSystemAdapter
-
Constructor Summary
Constructors Constructor Description WhatsAppTemplateMessageBuilderImpl(WhatsAppJmsExternalConversationSystemAdapter whatsAppJmsExternalConversationSystemAdapter)
-
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.WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl
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.WhatsAppTemplateMessageBuilderImpl.ButtonComponentBuilderImpl
button()
Initiates creation of the button.WhatsAppTemplateMessageBuilder
externalUserId(java.lang.String externalUserId)
The id of the recipient of the message.WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl
footer()
Initiates creation of the footer.WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl
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.
-
Field Details
-
whatsAppJmsExternalConversationSystemAdapter
protected final WhatsAppJmsExternalConversationSystemAdapter whatsAppJmsExternalConversationSystemAdapter -
templateMessage
-
-
Constructor Details
-
WhatsAppTemplateMessageBuilderImpl
public WhatsAppTemplateMessageBuilderImpl(WhatsAppJmsExternalConversationSystemAdapter whatsAppJmsExternalConversationSystemAdapter)
-
-
Method Details
-
timeToLive
Description copied from interface:WhatsAppTemplateMessageBuilder
Time To Live (TTL) duration.- Specified by:
timeToLive
in interfaceWhatsAppTemplateMessageBuilder
-
templateId
Description copied from interface:WhatsAppTemplateMessageBuilder
The id of the template that is registered on the WhatsApp side- Specified by:
templateId
in interfaceWhatsAppTemplateMessageBuilder
-
language
Description copied from interface:WhatsAppTemplateMessageBuilder
The language of the template that should be used.- Specified by:
language
in interfaceWhatsAppTemplateMessageBuilder
-
addTemplateTextParameter
Description copied from interface:WhatsAppTemplateMessageBuilder
Add a positional text parameter to the body.Short circuit for calling
WhatsAppTemplateMessageBuilder.body()
, thenWhatsAppTemplateMessageBuilder.ComponentBuilder.addTextParameter(String)
and thenWhatsAppTemplateMessageBuilder.ComponentBuilder.buildComponent()
Note: The parameter must be added in the correct order according to the template message.
- Specified by:
addTemplateTextParameter
in interfaceWhatsAppTemplateMessageBuilder
-
addTemplateTextParameters
public WhatsAppTemplateMessageBuilder addTemplateTextParameters(java.util.Collection<java.lang.String> parameters)Description copied from interface:WhatsAppTemplateMessageBuilder
Add positional text parameters to the body.Short circuit for calling
WhatsAppTemplateMessageBuilder.body()
, thenWhatsAppTemplateMessageBuilder.ComponentBuilder.addTextParameter(String)
and thenWhatsAppTemplateMessageBuilder.ComponentBuilder.buildComponent()
Note: The parameters must be added in the correct order according to the template message.
- Specified by:
addTemplateTextParameters
in interfaceWhatsAppTemplateMessageBuilder
-
externalUserId
Description copied from interface:WhatsAppTemplateMessageBuilder
The id of the recipient of the message. This is the id of the user within the WhatsApp system.- Specified by:
externalUserId
in interfaceWhatsAppTemplateMessageBuilder
-
businessAccountId
Description copied from interface:WhatsAppTemplateMessageBuilder
The id of the business account that should be used when sending out the message.- Specified by:
businessAccountId
in interfaceWhatsAppTemplateMessageBuilder
-
messageId
Description copied from interface:WhatsAppTemplateMessageBuilder
The id of the reference message within the Engage system. It is used in order to correlate the WhatsApp message and the Engage message.- Specified by:
messageId
in interfaceWhatsAppTemplateMessageBuilder
-
send
public void send()Description copied from interface:WhatsAppTemplateMessageBuilder
Perform the send of the template message.- Specified by:
send
in interfaceWhatsAppTemplateMessageBuilder
-
header
Description copied from interface:WhatsAppTemplateMessageBuilder
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.- Specified by:
header
in interfaceWhatsAppTemplateMessageBuilder
- Returns:
- header-specific builder.
-
body
Description copied from interface:WhatsAppTemplateMessageBuilder
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.- Specified by:
body
in interfaceWhatsAppTemplateMessageBuilder
- Returns:
- body-specific builder.
-
footer
Description copied from interface:WhatsAppTemplateMessageBuilder
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.- Specified by:
footer
in interfaceWhatsAppTemplateMessageBuilder
- Returns:
- footer-specific builder.
-
button
Description copied from interface:WhatsAppTemplateMessageBuilder
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.- Specified by:
button
in interfaceWhatsAppTemplateMessageBuilder
- Returns:
- button-specific builder.
-