| Total Complexity | 4 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class NotificationService |
||
| 13 | { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Send an email when the contact form is submitted |
||
| 17 | * |
||
| 18 | * @param array $data |
||
| 19 | * @param int $userId |
||
| 20 | * |
||
| 21 | * @return bool |
||
| 22 | */ |
||
| 23 | public function sendEmailContactMe(array $data, int $userId): bool |
||
| 24 | { |
||
| 25 | $user = User::find($userId); |
||
| 26 | $user->notify(new ContactMeMailNotification($data)); |
||
| 27 | |||
| 28 | return true; |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Send an email when the get a treatment form is submitted |
||
| 33 | * |
||
| 34 | * @param array $data |
||
| 35 | * @param int $userId |
||
| 36 | * |
||
| 37 | * @return bool |
||
| 38 | */ |
||
| 39 | public function sendEmailGetATreatment(array $data, int $userId): bool |
||
| 40 | { |
||
| 41 | $user = User::find($userId); |
||
| 42 | $user->notify(new GetATreatmentMailNotification($data)); |
||
| 43 | |||
| 44 | return true; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Send an email when the new testimonial form is submitted |
||
| 49 | * |
||
| 50 | * @param array $data |
||
| 51 | * @param int $userId |
||
| 52 | * |
||
| 53 | * @return bool |
||
| 54 | */ |
||
| 55 | public function sendEmailNewTestimonial(array $data, int $userId): bool |
||
| 56 | { |
||
| 57 | $user = User::find($userId); |
||
| 58 | $user->notify(new NewTestimonialMailNotification($data)); |
||
| 59 | |||
| 60 | return true; |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Send an email to expiring event organizer |
||
| 65 | * |
||
| 66 | * @param array $data |
||
| 67 | * @param Event $event |
||
| 68 | * |
||
| 69 | * @return bool |
||
| 70 | */ |
||
| 71 | public function sendEmailExpiringEvent(array $data, Event $event): bool |
||
| 75 | } |
||
| 76 | } |
||
| 77 |