| Total Complexity | 3 |
| Total Lines | 69 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | class EmailService |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * Send code on email for forgot password |
||
| 20 | * |
||
| 21 | * @param User $user |
||
| 22 | * @param $languageCode |
||
| 23 | */ |
||
| 24 | public function sendForgotPasswordCode(User $user, $languageCode) |
||
| 25 | { |
||
| 26 | Lang::setLocale($languageCode); |
||
| 27 | |||
| 28 | $sendMail = new SendMail( |
||
| 29 | $user->email, |
||
| 30 | Lang::get('forgot.subject'), |
||
| 31 | 'emails.forgot', |
||
| 32 | [ |
||
| 33 | 'name' => $user->name, |
||
| 34 | 'forgot_code' => $user->forgot_code |
||
| 35 | ] |
||
| 36 | ); |
||
| 37 | |||
| 38 | Queue::push(new SendMailJob($sendMail)); |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Send code on email for account activation |
||
| 43 | * |
||
| 44 | * @param $user |
||
| 45 | * @param $languageCode |
||
| 46 | */ |
||
| 47 | public function sendActivationCode(User $user, $languageCode) |
||
| 48 | { |
||
| 49 | Lang::setLocale($languageCode); |
||
| 50 | |||
| 51 | $sendMail = new SendMail( |
||
| 52 | $user->email, |
||
| 53 | Lang::get('activate.subject'), |
||
| 54 | 'emails.activation', |
||
| 55 | [ |
||
| 56 | 'name' => $user->name, |
||
| 57 | 'activation_code' => $user->activation_code |
||
| 58 | ] |
||
| 59 | ); |
||
| 60 | |||
| 61 | Queue::push(new SendMailJob($sendMail)); |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Send code on email for email change |
||
| 66 | * |
||
| 67 | * @param $user |
||
| 68 | * @param $languageCode |
||
| 69 | */ |
||
| 70 | public function sendEmailConfirmationCode(User $user, $languageCode) |
||
| 85 | } |
||
| 86 | } |
||
| 87 |