You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i set the plain_text Field on the emails array on create campaign the API returns a error and it returns a wrong one.
It says «The emails.0 field must be an array» alltough everything is set as in the API docs.
Expected Results
Both examples should work fine or return a correct error.
Actual Results
The API returns following error: «The emails.0 field must be an array»
Steps to Reproduce
<?php
use MailerLite\MailerLite;
require_once "vendor/autoload.php";
$mailerLite = new MailerLite([
"api_key" => "",
]);
// This request works as expected:
$response = $mailerLite->campaigns->create([
"type" => "regular",
"name" => "My new campaign",
"language_id" => 10,
"emails" => [
[
"subject" => "My new email",
"from_name" => "My Customer",
"from" => "email@mycustomer.com",
"content" => "Hello World!",
],
],
"filter" => [],
]);
// This request throws the error that emails.0 is not set, alltough the problem is with plain_text:
$response = $mailerLite->campaigns->create([
"type" => "regular",
"name" => "My new campaign",
"language_id" => 10,
"emails" => [
[
"subject" => "My new email",
"from_name" => "My Customer",
"from" => "email@mycustomer.com",
"content" => "Hello World!",
"plain_text" => "Hello World!",
],
],
"filter" => [],
]);
// PHP Fatal error: Uncaught MailerLite\Exceptions\MailerLiteValidationException: The emails.0 field must be an array
The text was updated successfully, but these errors were encountered:
Summary
When i set the plain_text Field on the emails array on create campaign the API returns a error and it returns a wrong one.
It says «The emails.0 field must be an array» alltough everything is set as in the API docs.
Expected Results
Both examples should work fine or return a correct error.
Actual Results
The API returns following error: «The emails.0 field must be an array»
Steps to Reproduce
The text was updated successfully, but these errors were encountered: