validation-bugsnag-email
This commit is contained in:
@@ -93,7 +93,7 @@ class AgentController extends Controller
|
||||
// returns to the page with all the variables and their datas
|
||||
$send_otp = DB::table('common_settings')->select('status')->where('option_name', '=', 'send_otp')->first();
|
||||
|
||||
return view('themes.default1.admin.helpdesk.agent.agents.create', compact('assign', 'teams', 'agents', 'timezones', 'groups', 'departments', 'team', 'send_otp'))->with('phonecode', $phonecode->phonecode);
|
||||
return view('themes.default1.admin.helpdesk.agent.agents.create', compact('teams', 'timezones', 'groups', 'departments', 'team', 'send_otp'))->with('phonecode', $phonecode->phonecode);
|
||||
} catch (Exception $e) {
|
||||
// returns if try fails with exception meaagse
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
@@ -111,6 +111,9 @@ class AgentController extends Controller
|
||||
*/
|
||||
public function store(User $user, AgentRequest $request)
|
||||
{
|
||||
if ($request->fails()) {
|
||||
return redirect('agents/create');
|
||||
}
|
||||
if ($request->get('country_code') == '' && ($request->get('phone_number') != '' || $request->get('mobile') != '')) {
|
||||
return redirect()->back()->with(['fails2' => Lang::get('lang.country-code-required-error'), 'country_code' => 1])->withInput();
|
||||
} else {
|
||||
@@ -195,7 +198,7 @@ class AgentController extends Controller
|
||||
$teams = $team->pluck('id', 'name')->toArray();
|
||||
$assign = $team_assign_agent->where('agent_id', $id)->pluck('team_id')->toArray();
|
||||
|
||||
return view('themes.default1.admin.helpdesk.agent.agents.edit', compact('teams', 'assign', 'table', 'teams1', 'selectedTeams', 'user', 'timezones', 'groups', 'departments', 'team', 'exp', 'counted'))->with('phonecode', $phonecode->phonecode);
|
||||
return view('themes.default1.admin.helpdesk.agent.agents.edit', compact('teams', 'assign', 'table', 'teams1', 'user', 'timezones', 'groups', 'departments', 'team', 'exp', 'counted'))->with('phonecode', $phonecode->phonecode);
|
||||
} catch (Exception $e) {
|
||||
return redirect('agents')->with('fail', Lang::get('lang.failed_to_edit_agent'));
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@ use App\Model\helpdesk\Utility\MailboxProtocol;
|
||||
use Crypt;
|
||||
use Exception;
|
||||
use Lang;
|
||||
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
|
||||
|
||||
/**
|
||||
* ======================================
|
||||
@@ -124,6 +125,7 @@ class EmailsController extends Controller
|
||||
|
||||
return $this->validateEmailError($send, $fetch);
|
||||
} catch (Exception $ex) {
|
||||
dd($ex->getMessage());
|
||||
$message = $ex->getMessage();
|
||||
if ($request->input('fetching_status') && imap_last_error()) {
|
||||
$message = imap_last_error();
|
||||
@@ -253,11 +255,10 @@ class EmailsController extends Controller
|
||||
|
||||
$this->emailService($driver, $service_request);
|
||||
$this->setMailConfig($driver, $address, $name, $username, $password, $enc, $host, $port);
|
||||
$transport = (new \Swift_SmtpTransport($host, $port, $enc));
|
||||
$transport = new EsmtpTransport($host, $port);
|
||||
$transport->setUsername($username);
|
||||
$transport->setPassword($password);
|
||||
$mailer = (new \Swift_Mailer($transport));
|
||||
$mailer->getTransport()->start();
|
||||
$transport->start();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@@ -220,7 +220,7 @@ class TeamController extends Controller
|
||||
// dd($a_id);
|
||||
$user = $user->whereIn('id', $a_id)->where('active', '=', 1)->orderBy('first_name')->get();
|
||||
// dd($user);
|
||||
return view('themes.default1.admin.helpdesk.agent.teams.edit', compact('agent_id', 'user', 'teams', 'allagents'));
|
||||
return view('themes.default1.admin.helpdesk.agent.teams.edit', compact('agent_id', 'user', 'teams'));
|
||||
} catch (Exception $e) {
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
}
|
||||
|
@@ -151,7 +151,7 @@ class UserController extends Controller
|
||||
}
|
||||
// displaying list of users with chumper datatables
|
||||
// return \Datatable::collection(User::where('role', "!=", "admin")->get())
|
||||
return \Datatables::of($users)
|
||||
return \Yajra\DataTables\Facades\DataTables::of($users)
|
||||
/* column username */
|
||||
->removeColumn('id', 'last_name', 'country_code', 'phone_number')
|
||||
->addColumn('user_name', function ($model) {
|
||||
|
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Common;
|
||||
|
||||
use Exception;
|
||||
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
|
||||
|
||||
class CommonMailer
|
||||
{
|
||||
@@ -12,17 +13,12 @@ class CommonMailer
|
||||
if (!$config) {
|
||||
return false;
|
||||
}
|
||||
$https = [];
|
||||
$https['ssl']['verify_peer'] = false;
|
||||
$https['ssl']['verify_peer_name'] = false;
|
||||
$transport = new \Swift_SmtpTransport($config['host'], $config['port'], $config['security']);
|
||||
$transport = new EsmtpTransport($config['host'], $config['port']);
|
||||
$transport->setUsername($config['username']);
|
||||
$transport->setPassword($config['password']);
|
||||
$transport->setStreamOptions($https);
|
||||
$set = new \Swift_Mailer($transport);
|
||||
|
||||
// Set the mailer
|
||||
\Mail::setSymfonyTransport($set);
|
||||
\Mail::setSymfonyTransport($transport);
|
||||
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
|
Reference in New Issue
Block a user