Completed
Push — master ( 857394...4794c5 )
by Mahmoud
03:25
created

SendContactUsEmailAction::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 4
1
<?php
2
3
namespace App\Containers\Contact\Actions;
4
5
use App\Containers\Contact\Tasks\SendContactUsEmailTask;
6
use App\Containers\Contact\Tasks\ValidateConfirmationCodeTask;
7
use App\Port\Action\Abstracts\Action;
8
9
/**
10
 * Class SendContactUsEmailAction.
11
 *
12
 * @author Mahmoud Zalt <[email protected]>
13
 */
14
class SendContactUsEmailAction extends Action
15
{
16
17
    /**
18
     * @var  \App\Containers\Contact\Tasks\SendContactUsEmailTask
19
     */
20
    private $sendContactUsEmailTask;
21
22
    /**
23
     * SendContactUsEmailAction constructor.
24
     *
25
     * @param \App\Containers\Contact\Tasks\SendContactUsEmailTask $sendContactUsEmailTask
26
     */
27
    public function __construct(SendContactUsEmailTask $sendContactUsEmailTask)
28
    {
29
        $this->sendContactUsEmailTask = $sendContactUsEmailTask;
30
    }
31
32
    /**
33
     * @param $fromEmail
34
     * @param $message
35
     * @param $subject
36
     * @param $fromName
37
     *
38
     * @return  bool
39
     */
40
    public function run($fromEmail, $message, $subject, $fromName)
41
    {
42
        // TODO: keep track of all messages in the system. Create a table in the DB to store messages while sending them
43
44
        $result = $this->sendContactUsEmailTask->run($fromEmail, $message, $subject, $fromName);
45
46
        return $result;
47
    }
48
}
49