Fixed outgoing mails disabled issue

Fixed language

Fixed languag and email create/edit issue

v1.10.2 build updates

Fixed codacy issues
This commit is contained in:
Manish Verma
2018-10-12 15:51:15 +05:30
committed by Manish Verma
parent ac4e053c2d
commit 6a3d093b4c
12 changed files with 33 additions and 13 deletions

View File

@@ -339,7 +339,9 @@ class TemplateController extends Controller
$this->PhpMailController->sendmail($from, $to_address, $message, [], []);
return redirect()->back()->with('success', 'Mail has send successfully');
return redirect()->back()->with(
'success',
trans('lang.mail-sent-to-job-for-process'));
} catch (Exception $e) {
return redirect()->back()->with('fails', $e->getMessage());
}

View File

@@ -26,7 +26,10 @@ class PhpMailController extends Controller
public function fetch_smtp_details($id)
{
$emails = Emails::where('id', '=', $id)->first();
$emails = Emails::where(
[['id', '=', $id],
['sending_status', '=', 1]])
->first();
return $emails;
}

View File

@@ -36,8 +36,13 @@ class SendEmail extends Job implements ShouldQueue
*/
public function handle(PhpMailController $PhpMailController)
{
$p = $PhpMailController->sendEmail($this->from, $this->to, $this->message, $this->template);
try {
$p = $PhpMailController->sendEmail($this->from, $this->to, $this->message, $this->template);
return $p;
return $p;
} catch (\Exception $e) {
logger()->warning($e->getMessage());
session()->flash('fails', $e->getMessage());
}
}
}