Skip to content

Commit 54b00a0

Browse files
committed
Do not use objects for queued mails
1 parent 8a5e670 commit 54b00a0

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

app/jobs/CheckWebsite.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ public function fire(Illuminate\Queue\Jobs\Job $job, $data)
4141

4242
if ($response->success) {
4343
if (isset($lastCheck) && !$lastCheck->success) {
44-
Mail::queue('email.check.online', array('check' => $check), function($message) use($check) {
45-
$message->to($check->theUser->email)
46-
->subject(trans('check.job.email.online.subject', array('title' => $check->title)));
44+
Mail::queue('email.check.online', array(
45+
'id' => $check->id,
46+
'title' => $check->title,
47+
),
48+
function($message) use($check) {
49+
$message->to($check->theUser->email)
50+
->subject(trans('check.job.email.online.subject', array('title' => $check->title)));
4751
});
4852
}
4953

@@ -59,10 +63,14 @@ public function fire(Illuminate\Queue\Jobs\Job $job, $data)
5963
}
6064
} else {
6165
if (isset($lastCheck) && $lastCheck->success) {
62-
Mail::queue('email.check.offline', array('check' => $check, 'response' => $response), function($message) use($check) {
63-
$message->to($check->theUser->email)
64-
->subject(trans('check.job.email.offline.subject', array('title' => $check->title)));
65-
66+
Mail::queue('email.check.offline', array(
67+
'id' => $check->id,
68+
'title' => $check->title,
69+
'statusCode' => $response->status_code
70+
),
71+
function($message) use($check) {
72+
$message->to($check->theUser->email)
73+
->subject(trans('check.job.email.offline.subject', array('title' => $check->title)));
6674
});
6775
}
6876

app/views/email/check/offline.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
@section('content')
88
<h1>{{ trans('check.job.email.offline.headline') }}</h1>
99

10-
<p>{{ trans('check.job.email.offline.content', array('url' => URL::route('check.show', array('id' => $check->id)), 'title' => $check->title, 'code' => $response->status_code)) }}</p>
11-
@stop
10+
<p>{{ trans('check.job.email.offline.content', array('url' => URL::route('check.show', array('id' => $id)), 'title' => $title, 'code' => $statusCode)) }}</p>
11+
@stop

app/views/email/check/online.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
@section('content')
88
<h1>{{ trans('check.job.email.online.headline') }}</h1>
99

10-
<p>{{ trans('check.job.email.online.content', array('url' => URL::route('check.show', array('id' => $check->id)), 'title' => $check->title)) }}</p>
11-
@stop
10+
<p>{{ trans('check.job.email.online.content', array('url' => URL::route('check.show', array('id' => $id)), 'title' => $title)) }}</p>
11+
@stop

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy