Documentation

InboundProcessor
in package

Table of Contents

Properties

$agentService  : AgentService
$messageService  : MessageService
$smsService  : SmsService

Methods

__construct()  : mixed
process()  : void
Process incoming Twilio webhook
calculateSimilarity()  : float
Calculate similarity between two strings (simple word-based similarity) Returns a value between 0 and 1, where 1 is identical
downloadFile()  : string
Download file from URL and store locally
extractFiles()  : array<string|int, mixed>
Extract file attachments from Twilio payload
findOrCreateUser()  : User
Find or create user by phone number
getExtensionFromMimeType()  : string
Get file extension from MIME type
handleOnboarding()  : void
Handle onboarding flow - send link to onboarding form
needsOnboarding()  : bool
Check if user needs onboarding

Properties

Methods

process()

Process incoming Twilio webhook

public process(array<string|int, mixed> $payload) : void
Parameters
$payload : array<string|int, mixed>

calculateSimilarity()

Calculate similarity between two strings (simple word-based similarity) Returns a value between 0 and 1, where 1 is identical

protected calculateSimilarity(string $str1, string $str2) : float
Parameters
$str1 : string
$str2 : string
Return values
float

downloadFile()

Download file from URL and store locally

protected downloadFile(string $url, string|null $contentType) : string
Parameters
$url : string
$contentType : string|null
Return values
string

extractFiles()

Extract file attachments from Twilio payload

protected extractFiles(array<string|int, mixed> $payload) : array<string|int, mixed>
Parameters
$payload : array<string|int, mixed>
Return values
array<string|int, mixed>

findOrCreateUser()

Find or create user by phone number

protected findOrCreateUser(string $phone) : User
Parameters
$phone : string
Return values
User

getExtensionFromMimeType()

Get file extension from MIME type

protected getExtensionFromMimeType(string|null $mimeType) : string
Parameters
$mimeType : string|null
Return values
string

handleOnboarding()

Handle onboarding flow - send link to onboarding form

protected handleOnboarding(mixed $user, string $message, bool $isFirstMessage, array<string|int, mixed> $payload) : void
Parameters
$user : mixed
$message : string
$isFirstMessage : bool
$payload : array<string|int, mixed>

needsOnboarding()

Check if user needs onboarding

protected needsOnboarding(mixed $user) : bool
Parameters
$user : mixed
Return values
bool

        
On this page

Search results