-
Notifications
You must be signed in to change notification settings - Fork 581
Closed
Description
Issue Summary
It is not possible to create a Template with friendly name using PHP library version 8.3.4
Steps to Reproduce
- Create a template using PHP library
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);
$twilio->content->v1->contents->create(
ContentModels::createContentCreateRequest(
[
'friendlyName' => 'my_template_friendly_name,
'language' => 'en',
'types' => [
'twilio/text' => [
'body' => 'this is a example body,
],
],
],
),
- When checking the template in Content Template Builder then
friendly_name not providedappears as a name
Technical details:
- twilio-php version: 8.3.4
- php version: 8.3
Hints
I think that the problem is in ContentCreateRequest file because the serialization is with camelCase instead snake_case
problem
public function jsonSerialize(): array
{
return [
'friendlyName' => $this->friendlyName,
'variables' => $this->variables,
'language' => $this->language,
'types' => $this->types
];
}
solution
public function jsonSerialize(): array
{
return [
'friendly_name' => $this->friendlyName,
'variables' => $this->variables,
'language' => $this->language,
'types' => $this->types
];
}
Metadata
Metadata
Assignees
Labels
No labels