Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public static function sendEmployeeConfirm($id){
  2. $employee=Employees::where('id', $id)->first();
  3. $token=Str::random(32);
  4. $employee->token=$token;
  5. $employee->save();
  6. $subject='Confirm account on Rota';
  7. $data=['employee'=>$employee, 'token'=>$token, 'subject'=>$subject];
  8. $subject='Confirmation of new account on Rota';
  9. Mail::send('admin.mails.new_employee', $data, function ($message) use ($subject, $employee) {
  10. if(env('APP_DEBUG')===true){
  11. $message->to('ghiurcaalin@gmail.com')
  12. ->subject($subject);
  13. $message->from('ghiurcaalin@gmail.com');
  14. }else{
  15. $message->to($employee->email)
  16. ->subject($subject);
  17. $message->from('rota@gmail.com');
  18. }
  19.  
  20. });
  21.  
  22. if (Mail::failures()) {
  23. return 0;
  24. }else{
  25. return 1;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement