Utils extends EdnaUtils
Table of Contents
Constants
- CACHE_DIR_TEMPLATES = '/messageservice/templates/'
- CACHE_KEY_TEMPLATES = 'whatsapp_templates_cache'
Methods
- __construct() : mixed
- checkActiveChannelBySubjectIdList() : bool
- cleanTemplatesCache() : void
- clearCache() : void
- getActiveChannelList() : Result
- getCascadeIdFromSubject() : Result
- getCascadeList() : Result
- getChannelList() : Result
- getMessageTemplates() : Result
- getSentTemplateMessage() : string
- prepareTemplateMessageText() : string
- sendTemplate() : Result
- setCallback() : Result
- updateSavedChannelList() : array<string|int, mixed>
- Loads channels from provider.
Constants
CACHE_DIR_TEMPLATES
public
mixed
CACHE_DIR_TEMPLATES
= '/messageservice/templates/'
CACHE_KEY_TEMPLATES
public
mixed
CACHE_KEY_TEMPLATES
= 'whatsapp_templates_cache'
Methods
__construct()
public
__construct(string $providerId, OptionManager $optionManager) : mixed
Parameters
- $providerId : string
- $optionManager : OptionManager
checkActiveChannelBySubjectIdList()
public
checkActiveChannelBySubjectIdList(array<string|int, mixed> $subjectIdList, string $imType) : bool
Parameters
- $subjectIdList : array<string|int, mixed>
- $imType : string
Return values
boolcleanTemplatesCache()
public
static cleanTemplatesCache() : void
clearCache()
public
clearCache(string $key) : void
Parameters
- $key : string
getActiveChannelList()
public
getActiveChannelList(string $imType) : Result
Parameters
- $imType : string
Return values
ResultgetCascadeIdFromSubject()
public
getCascadeIdFromSubject(int|string $subject, callable $subjectComparator) : Result
Parameters
- $subject : int|string
- $subjectComparator : callable
Return values
ResultgetCascadeList()
public
getCascadeList() : Result
Tags
Return values
ResultgetChannelList()
public
getChannelList(string $imType) : Result
Parameters
- $imType : string
Tags
Return values
ResultgetMessageTemplates()
public
getMessageTemplates([string $subject = '' ]) : Result
Parameters
- $subject : string = ''
Return values
ResultgetSentTemplateMessage()
public
getSentTemplateMessage(string $from, string $to) : string
Parameters
- $from : string
- $to : string
Return values
stringprepareTemplateMessageText()
public
prepareTemplateMessageText(array<string|int, mixed> $message) : string
Parameters
- $message : array<string|int, mixed>
Return values
stringsendTemplate()
public
sendTemplate(string $name, string $text[, array<string|int, mixed> $examples = [] ][, string|null $langCode = null ]) : Result
Parameters
- $name : string
- $text : string
- $examples : array<string|int, mixed> = []
- $langCode : string|null = null
Return values
ResultsetCallback()
public
setCallback(string $callbackUrl, array<string|int, mixed> $callbackTypes[, int|null $subjectId = null ]) : Result
Parameters
- $callbackUrl : string
- $callbackTypes : array<string|int, mixed>
- $subjectId : int|null = null
Tags
Return values
ResultupdateSavedChannelList()
Loads channels from provider.
public
updateSavedChannelList(string $channelType) : array<string|int, mixed>
Parameters
- $channelType : string