File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 22namespace Queue \Shell \Task ;
33
44use Cake \Log \Log ;
5+ use Cake \Mailer \Email ;
56use Exception ;
6- use Tools \Mailer \Email ;
77
88/**
99 * @author Mark Scherer
@@ -21,15 +21,24 @@ class QueueEmailTask extends QueueTask {
2121 'from ' => null ,
2222 ];
2323
24+ /**
25+ * @var int
26+ */
2427 public $ timeout = 120 ;
2528
29+ /**
30+ * @var int
31+ */
2632 public $ retries = 1 ;
2733
2834 /**
2935 * @var bool
3036 */
3137 public $ autoUnserialize = true ;
3238
39+ /**
40+ * @var \Cake\Network\Email
41+ */
3342 public $ Email ;
3443
3544 /**
@@ -100,7 +109,12 @@ public function run($data, $id = null) {
100109 }
101110 }
102111
103- $ this ->Email = new Email ();
112+ $ class = 'Tools\Mailer\Email ' ;
113+ if (!class_exists ($ class )) {
114+ $ class = 'Cake\Mailer\Email ' ;
115+ }
116+ $ this ->Email = new $ class ();
117+
104118 $ settings = array_merge ($ this ->defaults , $ data ['settings ' ]);
105119 foreach ($ settings as $ method => $ setting ) {
106120 call_user_func_array ([$ this ->Email , $ method ], (array )$ setting );
You can’t perform that action at this time.
0 commit comments