Class WhatsAppTemplateMessageBuilderImpl
java.lang.Object
com.flowable.engage.external.system.whatsapp.WhatsAppTemplateMessageBuilderImpl
- All Implemented Interfaces:
WhatsAppTemplateMessageBuilder
public class WhatsAppTemplateMessageBuilderImpl
extends Object
implements WhatsAppTemplateMessageBuilder
- Author:
- Filip Hrisafov, Anatolii Balakiriev
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
protected static enum
Nested classes/interfaces inherited from interface com.flowable.engage.external.system.whatsapp.api.WhatsAppTemplateMessageBuilder
WhatsAppTemplateMessageBuilder.ButtonComponentBuilder, WhatsAppTemplateMessageBuilder.ComponentBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final WhatsAppOutboundTemplateMessageDto
protected final WhatsAppJmsExternalConversationSystemAdapter
-
Constructor Summary
ConstructorsConstructorDescriptionWhatsAppTemplateMessageBuilderImpl
(WhatsAppJmsExternalConversationSystemAdapter whatsAppJmsExternalConversationSystemAdapter) -
Method Summary
Modifier and TypeMethodDescriptionaddTemplateTextParameter
(String parameter) Add a positional text parameter to the body.addTemplateTextParameters
(Collection<String> parameters) Add positional text parameters to the body.body()
Initiates creation of the body.businessAccountId
(String businessAccountId) The id of the business account that should be used when sending out the message.button()
Initiates creation of the button.externalUserId
(String externalUserId) The id of the recipient of the message.footer()
Initiates creation of the footer.header()
Initiates creation of the header.The language of the template that should be used.mediaHeader
(String mediaId) The content item ID for the media header.The id of the reference message within the Engage system.void
send()
Perform the send of the template message.templateId
(String templateId) The id of the template that is registered on the WhatsApp sidetimeToLive
(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
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.
-
mediaHeader
Description copied from interface:WhatsAppTemplateMessageBuilder
The content item ID for the media header.- Specified by:
mediaHeader
in interfaceWhatsAppTemplateMessageBuilder
- Parameters:
mediaId
- the media header
-
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.
-
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.
-