@@ -17,9 +17,9 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function register() |
| 19 | 19 | { |
| 20 | - $this->app->afterResolving(MailManager::class, function (MailManager $mail_manager) { |
|
| 21 | - $mail_manager->extend("sendgrid", function ($config) { |
|
| 22 | - if (! isset($config['api_key'])) { |
|
| 20 | + $this->app->afterResolving(MailManager::class, function(MailManager $mail_manager) { |
|
| 21 | + $mail_manager->extend("sendgrid", function($config) { |
|
| 22 | + if (!isset($config['api_key'])) { |
|
| 23 | 23 | $config = $this->app['config']->get('services.sendgrid', []); |
| 24 | 24 | } |
| 25 | 25 | $client = new HttpClient(Arr::get($config, 'guzzle', [])); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | $payload = [ |
| 79 | 79 | 'headers' => [ |
| 80 | - 'Authorization' => 'Bearer ' . $this->apiKey, |
|
| 80 | + 'Authorization' => 'Bearer '.$this->apiKey, |
|
| 81 | 81 | 'Content-Type' => 'application/json', |
| 82 | 82 | ], |
| 83 | 83 | 'json' => $data, |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | private function getAttachmentContentType(Datapart $dataPart): string |
| 211 | 211 | { |
| 212 | - return $dataPart->getMediaType() . '/' . $dataPart->getMediaSubtype(); |
|
| 212 | + return $dataPart->getMediaType().'/'.$dataPart->getMediaSubtype(); |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
@@ -259,10 +259,10 @@ discard block |
||
| 259 | 259 | foreach ($personalizations as $index => $params) { |
| 260 | 260 | foreach ($params as $key => $val) { |
| 261 | 261 | if (in_array($key, ['to', 'cc', 'bcc'])) { |
| 262 | - Arr::set($data, 'personalizations.' . $index . '.' . $key, $val); |
|
| 262 | + Arr::set($data, 'personalizations.'.$index.'.'.$key, $val); |
|
| 263 | 263 | ++$this->numberOfRecipients; |
| 264 | 264 | } else { |
| 265 | - Arr::set($data, 'personalizations.' . $index . '.' . $key, $val); |
|
| 265 | + Arr::set($data, 'personalizations.'.$index.'.'.$key, $val); |
|
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | 268 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | $isValidInstance = $this instanceof Mailable || $this instanceof MailMessage; |
| 20 | 20 | |
| 21 | 21 | if ($isValidInstance && $this->mailDriver() == "sendgrid") { |
| 22 | - $this->withSymfonyMessage(function (Email $email) use ($params) { |
|
| 22 | + $this->withSymfonyMessage(function(Email $email) use ($params) { |
|
| 23 | 23 | $email->embed(static::sgEncode($params), SendgridTransport::REQUEST_BODY_PARAMETER); |
| 24 | 24 | }); |
| 25 | 25 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | public static function sgDecode($strParams) |
| 54 | 54 | { |
| 55 | 55 | if (!is_string($strParams)) { |
| 56 | - return (array)$strParams; |
|
| 56 | + return (array) $strParams; |
|
| 57 | 57 | } |
| 58 | 58 | $params = json_decode($strParams, true); |
| 59 | 59 | return is_array($params) ? $params : []; |