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) public function mailfrom($reg, $dept_id)
{ {
$email_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); $email = Email::find(1);
if ($emails && $emails->sending_status) { if ($dept_mail && $dept_mail->outgoing_email != '') {
$email_id = $emails->id; $email_id = $dept_mail->outgoing_email;
} else { } else {
$email_id = $email->sys_email; $email_id = $email->sys_email;
} }
return $email_id; return $email_id;
} }