Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function sendEmployeeConfirm($id){
- $employee=Employees::where('id', $id)->first();
- $token=Str::random(32);
- $employee->token=$token;
- $employee->save();
- $subject='Confirm account on Rota';
- $data=['employee'=>$employee, 'token'=>$token, 'subject'=>$subject];
- $subject='Confirmation of new account on Rota';
- Mail::send('admin.mails.new_employee', $data, function ($message) use ($subject, $employee) {
- if(env('APP_DEBUG')===true){
- $message->to('ghiurcaalin@gmail.com')
- ->subject($subject);
- $message->from('ghiurcaalin@gmail.com');
- }else{
- $message->to($employee->email)
- ->subject($subject);
- $message->from('rota@gmail.com');
- }
- });
- if (Mail::failures()) {
- return 0;
- }else{
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement