File tree 2 files changed +11
-12
lines changed
2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,19 @@ class PostProcessingEmailTrackingEvent extends OrgAction
22
22
23
23
public function handle (EmailTrackingEvent $ emailTrackingEvent ): EmailTrackingEvent
24
24
{
25
- $ parsedUserAgent = (new Browser ())->parse (Arr::get ($ emailTrackingEvent ->data , 'userAgent ' ));
25
+ $ ip = Arr::get ($ emailTrackingEvent ->data , 'ipAddress ' );
26
+ $ userAgent = Arr::get ($ emailTrackingEvent ->data , 'userAgent ' );
26
27
27
- $ ip = Arr::get ($ emailTrackingEvent ->data , 'ipAddress ' );
28
- $ device = $ parsedUserAgent ->deviceType ();
28
+ $ device = null ;
29
+ if ($ userAgent ) {
30
+ $ parsedUserAgent = (new Browser ())->parse ($ userAgent );
31
+ $ device = $ parsedUserAgent ->deviceType ();
32
+ }
29
33
30
34
return $ this ->update ($ emailTrackingEvent , [
31
- 'ip ' => $ ip ,
35
+ 'ip ' => $ ip ,
32
36
'device ' => $ device ,
33
- 'data ' => (object ) []
34
- ]);
37
+ 'data ' => (object )[]
38
+ ]);
35
39
}
36
40
}
Original file line number Diff line number Diff line change @@ -172,12 +172,7 @@ public function asCommand(Command $command): int
172
172
}
173
173
$ command ->line ('Number ses notifications to process ' .SesNotification::count ());
174
174
175
- foreach (SesNotification::all () as $ sesNotification ) {
176
- $ pending = $ this ->handle ($ sesNotification );
177
- if ($ pending ) {
178
- // print_r($pending);
179
- }
180
- }
175
+
181
176
182
177
return 0 ;
183
178
}
You can’t perform that action at this time.
0 commit comments