Skip to content
This repository was archived by the owner on Aug 27, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions source/Integrate/Frameworks/laravel.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,18 @@ Another useful feature of sendgrid is the notifications. If you want to complete
{% codeblock lang:php %}
<?php

Mail::send('emails.demo', $data, function($message)
{
$data['category'] = 'category;
$data['unique_args']['variable_1'] = 'abc';

$header = $this->asString($data);

$message->getSwiftMessage()->getHeaders()->addTextHeader('X-SMTPAPI', $header);

$message->to('[email protected]', 'Jane Doe')->subject('This is a demo!');
});
Mail::send('emails.view', $data, function ($message)
{
$data['category'] = 'category';
$data['unique_args']['variable_1'] = 'abc';

$header = $this->asString($data);

$message->getSwiftMessage()->getHeaders()->addTextHeader('X-SMTPAPI', $header);

$message->to('[email protected]', 'Jane Doe')->subject('This is a demo!');
});


private function asJSON($data) // set as private with the expectation of being a class method
{
Expand Down