I am using mailgun to help me with sending mails on laravel.
Here mail code:
$data = array('name' => ucfirst($customer_name),'email' => $email, 'ticket_id' => $ticket_id);
$mail_data = array('name' => ucfirst($customer_name),'email' => $email, 'mobile' => $contact, 'address' => $address, 'delivery_type' => ucfirst(Input::get('delivery_type')), 'pickup_type' => ucfirst(Input::get('pickup_type')), 'pickup_date' => $pickup_date, 'pickup_time' => $pickup_time, 'brand' => $brand_name, 'ticket_id' => $ticket_id, 'city' => $region_name);
Mailgun::send('emails.ticket', $mail_data , function($message) use($data)
{
$message->to($data['email'], $data['name'])
->bcc(array('myemail@mydomain.com, aotheremail@mydomain.com, onemore@mydomain.com, lastone@mydomain.com'))
->subject('Service Request! - '.$data['ticket_id']);
});
I checked the logs figured out:
[2016-12-29 05:58:58] production.ERROR: exception 'Mailgun\Connection\Exceptions\MissingRequiredParameters' with message 'The parameters passed to the API were invalid. Check your inputs! Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authorized recipients in Account Settings.' in /var/www/html/mysite/vendor/mailgun/mailgun-php/src/Mailgun/Connection/RestClient.php:169
Stack trace:
#0 /var/www/html/mysite/vendor/mailgun/mailgun-php/src/Mailgun/Connection/RestClient.php(88): Mailgun\Connection\RestClient->responseHandler(Object(GuzzleHttp\Message\Response))
#1 /var/www/html/mysite/vendor/mailgun/mailgun-php/src/Mailgun/Mailgun.php(106): Mailgun\Connection\RestClient->post('sandbox798d350d...', Array, Array)
#2 /var/www/html/mysite/vendor/mailgun/mailgun-php/src/Mailgun/Mailgun.php(53): Mailgun\Mailgun->post('sandbox798d350d...', Array, Array)
#3 /var/www/html/mysite/vendor/bogardo/mailgun/src/Bogardo/Mailgun/Mailgun.php(104): Mailgun\Mailgun->sendMessage('sandbox798d350d...', Array, Array)
#4 /var/www/html/mysite/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(222): Bogardo\Mailgun\Mailgun->send('emails.ticket', Array, Object(Closure))
#5 /var/www/html/mysite/app/Http/Controllers/AppController.php(384): Illuminate\Support\Facades\Facade::__callStatic('send', Array)
#6 /var/www/html/mysite/app/Http/Controllers/AppController.php(384): Bogardo\Mailgun\Facades\Mailgun::send('emails.ticket', Array, Object(Closure))
#7 [internal function]: App\Http\Controllers\AppController->pickup_request()
#8 /var/www/html/mysite/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(256): call_user_func_array(Array, Array)
#9 /var/www/html/mysite/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(164): Illuminate\Routing\Controller->callAction('pickup_request', Array)
I am not able to figure where the problem is? is it the syntax error? or what could be wrong?
It used to work properly now it has stopped.
Thanks!
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire