php
namespace App\Notifications;
use DigitalRisks\Notifications\Messages\HubspotMessage;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
class SomethingHappened extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['hubspot'];
}
/**
* Get the hubspot representation of the notification.
*
* @param mixed $notifiable
* @return \DigitalRisks\Notifications\Messages\HubspotMessage
*/
public function toMail($notifiable)
{
return (new HubspotMessage)
->templateId(config('services.hubspot.template_id'))
->contactProperties([])
->customProperties([]);
}
}
php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
/**
* Route notifications for the Hubspot channel.
*
* @param \Illuminate\Notifications\Notification $notification
* @return string
*/
public function routeNotificationForHubspot($notification)
{
return $this->email;
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.