<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
appletonlearning / laravel-postmark-channel example snippets
class User extends Eloquent
{
use Notifiable;
public function routeNotificationForPostmark()
{
return $this->email;
}
}
use Spur\Postmark\PostmarkChannel;
use Spur\Postmark\PostmarkMessage;
class InvoiceNotification extends Notification
{
public function via($notifiable)
{
return [PostmarkChannel::class];
}
public function toPostmark($notifiable)
{
$url = url('/invoice/'.$this->invoice->id);
return (new PostmarkMessage)
->greeting('Hello!')
->line('One of your invoices has been paid!')
->action('View Invoice', $url)
->line('Thank you for using our application!');
}
}
public function toPostmark($notifiable)
{
$url = url('/invoice/'.$this->invoice->id);
return (new PostmarkMessage)
->subject('Invoice Paid')
->markdown('mail.invoice.paid', ['url' => $url]);
}
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
'Illuminate\Notifications\Events\NotificationSent' => [
'App\Listeners\LogNotification',
],
];
/**
* Handle the event.
*
* @param NotificationSent $event
* @return void
*/
public function handle(NotificationSent $event)
{
// $event->channel
// $event->notifiable
// $event->notification
// $event->response
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.