This commit is contained in:
Manish Verma
2017-02-07 01:38:41 +05:30
parent dcb758d7f6
commit 92e54c791e

View File

@@ -51,15 +51,13 @@ class PhpMailController extends Controller
public function mailfrom($reg, $dept_id)
{
$email_id = '';
$emails = Emails::where('department', '=', $dept_id)->first();
$dept_mail = Department::select('outgoing_email')->where('id', '=', $dept_id)->first();
$email = Email::find(1);
if ($emails && $emails->sending_status) {
$email_id = $emails->id;
if ($dept_mail && $dept_mail->outgoing_email != '') {
$email_id = $dept_mail->outgoing_email;
} else {
$email_id = $email->sys_email;
}
return $email_id;
}