Getting error routeNotificationFor() on laravel notifications
up vote
0
down vote
favorite
I'm trying to send email to members on my app and I get the following error:
production.ERROR: Call to undefined method
IlluminateDatabaseQueryBuilder::routeNotificationFor()
{"exception":"[object] (BadMethodCallException(code: 0): Call to
undefined method
IlluminateDatabaseQueryBuilder::routeNotificationFor() at
/var/www/vhosts/.../laravel/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2483)
I have the members model with the Notifiable
trait and the weird issue is that on my local machine the emails are delivered... The problem is on production...
Any ideas?
The notifications are fired with:
Notification::send($members_to_notify, new CommMessage($communication));
And the CommMessage
class is:
CommMessage.php
namespace AppNotificationsCommunications;
use IlluminateBusQueueable;
use IlluminateNotificationsNotification;
use IlluminateContractsQueueShouldQueue;
use IlluminateNotificationsMessagesMailMessage;
use AppMailCommunicationsMessage as Mailable;
class CommMessage extends Notification implements ShouldQueue
{
use Queueable;
private $communication;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct($communication)
{
$this->communication = $communication;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return Mailable
*/
public function toMail($notifiable)
{
return (new Mailable($this->communication))->to($notifiable->email);
}
}
The mailable Message
class is:
Message.php
namespace AppMailCommunications;
use IlluminateBusQueueable;
use IlluminateMailMailable;
use IlluminateQueueSerializesModels;
use IlluminateContractsQueueShouldQueue;
class Message extends Mailable
{
use Queueable, SerializesModels;
/**
* The appointment instance.
*
* @var Appointment
*/
public $communication;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($communication)
{
$this->communication = $communication;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$this->replyTo($this->communication->school->email)
->markdown('emails.communications.message');
$this->subject($this->communication->title);
$this->withSwiftMessage(function ($message) {
$message->getHeaders()
->addTextHeader('X-Mailgun-Variables', json_encode([
'model_id' => $this->communication->id,
'model' => get_class($this->communication),
'email_type' => 11 //Communication message (EmailLogType)
]));
});
}
}
laravel email notifications
add a comment |
up vote
0
down vote
favorite
I'm trying to send email to members on my app and I get the following error:
production.ERROR: Call to undefined method
IlluminateDatabaseQueryBuilder::routeNotificationFor()
{"exception":"[object] (BadMethodCallException(code: 0): Call to
undefined method
IlluminateDatabaseQueryBuilder::routeNotificationFor() at
/var/www/vhosts/.../laravel/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2483)
I have the members model with the Notifiable
trait and the weird issue is that on my local machine the emails are delivered... The problem is on production...
Any ideas?
The notifications are fired with:
Notification::send($members_to_notify, new CommMessage($communication));
And the CommMessage
class is:
CommMessage.php
namespace AppNotificationsCommunications;
use IlluminateBusQueueable;
use IlluminateNotificationsNotification;
use IlluminateContractsQueueShouldQueue;
use IlluminateNotificationsMessagesMailMessage;
use AppMailCommunicationsMessage as Mailable;
class CommMessage extends Notification implements ShouldQueue
{
use Queueable;
private $communication;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct($communication)
{
$this->communication = $communication;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return Mailable
*/
public function toMail($notifiable)
{
return (new Mailable($this->communication))->to($notifiable->email);
}
}
The mailable Message
class is:
Message.php
namespace AppMailCommunications;
use IlluminateBusQueueable;
use IlluminateMailMailable;
use IlluminateQueueSerializesModels;
use IlluminateContractsQueueShouldQueue;
class Message extends Mailable
{
use Queueable, SerializesModels;
/**
* The appointment instance.
*
* @var Appointment
*/
public $communication;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($communication)
{
$this->communication = $communication;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$this->replyTo($this->communication->school->email)
->markdown('emails.communications.message');
$this->subject($this->communication->title);
$this->withSwiftMessage(function ($message) {
$message->getHeaders()
->addTextHeader('X-Mailgun-Variables', json_encode([
'model_id' => $this->communication->id,
'model' => get_class($this->communication),
'email_type' => 11 //Communication message (EmailLogType)
]));
});
}
}
laravel email notifications
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to send email to members on my app and I get the following error:
production.ERROR: Call to undefined method
IlluminateDatabaseQueryBuilder::routeNotificationFor()
{"exception":"[object] (BadMethodCallException(code: 0): Call to
undefined method
IlluminateDatabaseQueryBuilder::routeNotificationFor() at
/var/www/vhosts/.../laravel/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2483)
I have the members model with the Notifiable
trait and the weird issue is that on my local machine the emails are delivered... The problem is on production...
Any ideas?
The notifications are fired with:
Notification::send($members_to_notify, new CommMessage($communication));
And the CommMessage
class is:
CommMessage.php
namespace AppNotificationsCommunications;
use IlluminateBusQueueable;
use IlluminateNotificationsNotification;
use IlluminateContractsQueueShouldQueue;
use IlluminateNotificationsMessagesMailMessage;
use AppMailCommunicationsMessage as Mailable;
class CommMessage extends Notification implements ShouldQueue
{
use Queueable;
private $communication;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct($communication)
{
$this->communication = $communication;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return Mailable
*/
public function toMail($notifiable)
{
return (new Mailable($this->communication))->to($notifiable->email);
}
}
The mailable Message
class is:
Message.php
namespace AppMailCommunications;
use IlluminateBusQueueable;
use IlluminateMailMailable;
use IlluminateQueueSerializesModels;
use IlluminateContractsQueueShouldQueue;
class Message extends Mailable
{
use Queueable, SerializesModels;
/**
* The appointment instance.
*
* @var Appointment
*/
public $communication;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($communication)
{
$this->communication = $communication;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$this->replyTo($this->communication->school->email)
->markdown('emails.communications.message');
$this->subject($this->communication->title);
$this->withSwiftMessage(function ($message) {
$message->getHeaders()
->addTextHeader('X-Mailgun-Variables', json_encode([
'model_id' => $this->communication->id,
'model' => get_class($this->communication),
'email_type' => 11 //Communication message (EmailLogType)
]));
});
}
}
laravel email notifications
I'm trying to send email to members on my app and I get the following error:
production.ERROR: Call to undefined method
IlluminateDatabaseQueryBuilder::routeNotificationFor()
{"exception":"[object] (BadMethodCallException(code: 0): Call to
undefined method
IlluminateDatabaseQueryBuilder::routeNotificationFor() at
/var/www/vhosts/.../laravel/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2483)
I have the members model with the Notifiable
trait and the weird issue is that on my local machine the emails are delivered... The problem is on production...
Any ideas?
The notifications are fired with:
Notification::send($members_to_notify, new CommMessage($communication));
And the CommMessage
class is:
CommMessage.php
namespace AppNotificationsCommunications;
use IlluminateBusQueueable;
use IlluminateNotificationsNotification;
use IlluminateContractsQueueShouldQueue;
use IlluminateNotificationsMessagesMailMessage;
use AppMailCommunicationsMessage as Mailable;
class CommMessage extends Notification implements ShouldQueue
{
use Queueable;
private $communication;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct($communication)
{
$this->communication = $communication;
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return Mailable
*/
public function toMail($notifiable)
{
return (new Mailable($this->communication))->to($notifiable->email);
}
}
The mailable Message
class is:
Message.php
namespace AppMailCommunications;
use IlluminateBusQueueable;
use IlluminateMailMailable;
use IlluminateQueueSerializesModels;
use IlluminateContractsQueueShouldQueue;
class Message extends Mailable
{
use Queueable, SerializesModels;
/**
* The appointment instance.
*
* @var Appointment
*/
public $communication;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($communication)
{
$this->communication = $communication;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$this->replyTo($this->communication->school->email)
->markdown('emails.communications.message');
$this->subject($this->communication->title);
$this->withSwiftMessage(function ($message) {
$message->getHeaders()
->addTextHeader('X-Mailgun-Variables', json_encode([
'model_id' => $this->communication->id,
'model' => get_class($this->communication),
'email_type' => 11 //Communication message (EmailLogType)
]));
});
}
}
laravel email notifications
laravel email notifications
edited yesterday
Saumini Navaratnam
4,20411542
4,20411542
asked 2 days ago
Dani Pereyra
3818
3818
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
This issue was solved. Code has no errors, I was using Supervisor to manage queues and I have forgot to restart it on production server.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
This issue was solved. Code has no errors, I was using Supervisor to manage queues and I have forgot to restart it on production server.
add a comment |
up vote
0
down vote
This issue was solved. Code has no errors, I was using Supervisor to manage queues and I have forgot to restart it on production server.
add a comment |
up vote
0
down vote
up vote
0
down vote
This issue was solved. Code has no errors, I was using Supervisor to manage queues and I have forgot to restart it on production server.
This issue was solved. Code has no errors, I was using Supervisor to manage queues and I have forgot to restart it on production server.
answered yesterday
Dani Pereyra
3818
3818
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53234937%2fgetting-error-routenotificationfor-on-laravel-notifications%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password