Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function spark($template_id, $substituteData = []) |
||
18 | { |
||
19 | $firstNameColumn = config('sparkify.first_name_column'); |
||
20 | $lastNameColumn = config('sparkify.last_name_column'); |
||
21 | $emailColumn = config('sparkify.email_column'); |
||
22 | |||
23 | $substituteData['name'] = trim($this->{$firstNameColumn} . ' ' . $this->{$lastNameColumn}); |
||
24 | |||
25 | $postFields = [ |
||
26 | "recipients" => [ |
||
27 | [ |
||
28 | "address" => $this->{$emailColumn}, |
||
29 | "substitution_data"=> $substituteData |
||
30 | ] |
||
31 | ], |
||
32 | "content" => [ |
||
33 | "template_id" => $template_id |
||
34 | ] |
||
35 | ]; |
||
36 | |||
37 | dispatch(new SendSpark($postFields)); |
||
38 | } |
||
39 | } |
||
40 |