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
];
}
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
];
}