Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function send(Email $email) |
||
25 | { |
||
26 | if (!empty($this->_config['queue'])) { |
||
27 | $this->_config = $this->_config['queue'] + $this->_config; |
||
28 | $email->setConfig((array)$this->_config['queue'] + [ |
||
29 | 'queue' => [] |
||
30 | ]); |
||
31 | unset($this->_config['queue']); |
||
32 | } |
||
33 | |||
34 | $transport = $this->_config['transport']; |
||
35 | $email->setTransport($transport); |
||
36 | |||
37 | /** @var \Queue\Model\Table\QueuedTasksTable $QueuedTasks */ |
||
38 | $QueuedTasks = TableRegistry::getTableLocator()->get('Queue.QueuedTasks'); |
||
39 | $result = $QueuedTasks->createJob('Email', [ |
||
40 | 'transport' => $transport, |
||
41 | 'settings' => $email |
||
42 | ]); |
||
43 | $result['headers'] = ''; |
||
44 | $result['message'] = ''; |
||
45 | |||
46 | return $result->toArray(); |
||
47 | } |
||
49 |