Applied fixes from StyleCI
This commit is contained in:

committed by
StyleCI Bot

parent
3316345ebe
commit
18b6eec7cb
@@ -10,14 +10,16 @@ use App\Model\helpdesk\Settings\Email;
|
||||
use App\User;
|
||||
use Auth;
|
||||
|
||||
class PhpMailController extends Controller {
|
||||
|
||||
public function fetch_smtp_details($id) {
|
||||
class PhpMailController extends Controller
|
||||
{
|
||||
public function fetch_smtp_details($id)
|
||||
{
|
||||
$emails = Emails::where('id', '=', $id)->first();
|
||||
if ($emails->sending_status == 1) {
|
||||
return $emails;
|
||||
} else {
|
||||
$emails = null;
|
||||
|
||||
return $emails;
|
||||
}
|
||||
}
|
||||
@@ -27,7 +29,8 @@ class PhpMailController extends Controller {
|
||||
*
|
||||
* @return Mail
|
||||
*/
|
||||
public function sendmail($from, $to, $message, $template_variables) {
|
||||
public function sendmail($from, $to, $message, $template_variables)
|
||||
{
|
||||
// dd($from);
|
||||
$from_address = $this->fetch_smtp_details($from);
|
||||
if ($from_address == null) {
|
||||
@@ -179,10 +182,10 @@ class PhpMailController extends Controller {
|
||||
|
||||
$path2 = \Config::get('view.paths');
|
||||
|
||||
$directory = $path2[0] . '\emails' . DIRECTORY_SEPARATOR . $status->template . DIRECTORY_SEPARATOR;
|
||||
$directory = $path2[0].'\emails'.DIRECTORY_SEPARATOR.$status->template.DIRECTORY_SEPARATOR;
|
||||
|
||||
$handle = fopen($directory . $template . '.blade.php', 'r');
|
||||
$contents = fread($handle, filesize($directory . $template . '.blade.php'));
|
||||
$handle = fopen($directory.$template.'.blade.php', 'r');
|
||||
$contents = fread($handle, filesize($directory.$template.'.blade.php'));
|
||||
fclose($handle);
|
||||
|
||||
$variables = ['{!!$user!!}', '{!!$agent!!}', '{!!$ticket_number!!}', '{!!$content!!}', '{!!$from!!}', '{!!$ticket_agent_name!!}', '{!!$ticket_client_name!!}', '{!!$ticket_client_email!!}', '{!!$ticket_body!!}', '{!!$ticket_assigner!!}', '{!!$ticket_link_with_number!!}', '{!!$system_error!!}', '{!!$agent_sign!!}', '{!!$department_sign!!}', '{!!$password_reset_link!!}', '{!!$email_address!!}', '{!!$user_password!!}', '{!!$system_from!!}', '{!!$system_link!!}'];
|
||||
@@ -241,7 +244,7 @@ class PhpMailController extends Controller {
|
||||
$mail->Subject = $subject;
|
||||
if ($template == 'ticket-reply-agent') {
|
||||
$line = '---Reply above this line--- <br/><br/>';
|
||||
$mail->Body = $line . $messagebody;
|
||||
$mail->Body = $line.$messagebody;
|
||||
} else {
|
||||
$mail->Body = $messagebody;
|
||||
}
|
||||
@@ -249,7 +252,7 @@ class PhpMailController extends Controller {
|
||||
// $mail->AltBody = $altbody;
|
||||
|
||||
if (!$mail->send()) {
|
||||
return null;
|
||||
return;
|
||||
// echo 'Message could not be sent.';
|
||||
// echo 'Mailer Error: '.$mail->ErrorInfo;
|
||||
} else {
|
||||
@@ -264,7 +267,8 @@ class PhpMailController extends Controller {
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function company() {
|
||||
public function company()
|
||||
{
|
||||
$company = Company::Where('id', '=', '1')->first();
|
||||
if ($company->company_name == null) {
|
||||
$company = 'Support Center';
|
||||
@@ -326,7 +330,8 @@ class PhpMailController extends Controller {
|
||||
*
|
||||
* @return type integer
|
||||
*/
|
||||
public function mailfrom($reg, $dept_id) {
|
||||
public function mailfrom($reg, $dept_id)
|
||||
{
|
||||
$email = Email::where('id', '=', '1')->first();
|
||||
if ($reg == 1) {
|
||||
return $email->sys_email;
|
||||
@@ -339,5 +344,4 @@ class PhpMailController extends Controller {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user