"Class 'MailWizzApi_Config' not found" error in laravel

alex lari

New Member
hi,
I'm trying to use Mailwizz SDK to subscribe to my users in the Laravel application.
in local, it works well but when im trying to use it in production I get this error.

Class 'MailWizzApi_Config' not found

how can I fix that?
if you know any documentation that shows how I can use restful api please post it to me.

also, this is my code:

public static function addToList(string $email, $first_name = null, $last_name = null)
{
$config = new \MailWizzApi_Config([
'apiUrl' => env('MAILWIZ_URL'),
'publicKey' => env('MAILWIZ_PUBLIC'),
'privateKey' => env('MAILWIZ_PRIVATE')
]);

\MailWizzApi_Base::setConfig($config);

$endpoint = new \MailWizzApi_Endpoint_ListSubscribers();

$response = $endpoint->create(env('MAILWIZ_LIST'), [
'EMAIL' => $email,
'FNAME' => $first_name,
'LNAME' => $last_name
]);

return [
'status' => $response->getIsSuccess(),
'body' => $response->body
];
}
 
@alex lari - i assume you installed the sdk via composer right?
What is the difference between the test and production versions of your app? I assume it's just the php version?
Are you sure you installed the sdk in the live version as well?
 
Back
Top