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

SendContactUsEmailAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 35
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 8 1
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