Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/vhost/ats.isankalpa.org/app/Repositories/Mail/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/vhost/ats.isankalpa.org/app/Repositories/Mail/MailRepository.php
<?php namespace App\Repositories\Mail;


use Illuminate\Support\Facades\Crypt;

use Request;
use Input;
use Mail;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\DB;

class MailRepository {

    public $support_email, $cc_email = '';
    
    /*public function __construct(){

        $this->tbl_configuration_master = config( 'app.CUSTOM_CONFIG.DB_TABLES.CONFIGURATION_MASTER' );

        
        $get_emails = DB::table($this->tbl_configuration_master)->where('i_id', 1)->first();
        
        $email_lists = $get_emails->email_list;
        $email_cc_lists = $get_emails->email_cc_list;

        $this->noReply = [
            'email' => env('MAIL_FROM_ADDRESS',''),
            'title' => env('MAIL_FROM_NAME','')
        ];
        
        // Support email
        if(env('APP_ENV') == 'local' || strtolower(env('APP_ENV')) == 'dev' || strtolower(env('APP_ENV')) == 'uat')
        {
            $this->support_email = explode(',',env('EMAIL_TO_LIST', ''));
            //$this->support_email = explode(',',$email_lists);
            $cc = env('EMAIL_CC_LIST', '');
            $this->cc_email = $cc != '' ? explode(',',$cc) : [];
        }
        else
        {
            $this->support_email = [];
            $this->cc_email = [];
        }
        /*$this->tbl_configuration_master = config('app.CUSTOM_CONFIG.DB_TABLES.CONFIGURATION_MASTER');

        try {
            $get_emails = DB::table($this->tbl_configuration_master)->where('i_id', 1)->first();

            if (!empty($get_emails)) {
                $email_lists = $get_emails->email_list;
                $email_cc_lists = $get_emails->email_cc_list;

                $this->noReply = [
                    'email' => env('MAIL_FROM_ADDRESS', ''),
                    'title' => env('MAIL_FROM_NAME', '')
                ];

                // Support email
                if (env('APP_ENV') == 'local' || strtolower(env('APP_ENV')) == 'dev' || strtolower(env('APP_ENV')) == 'uat') {
                    $this->support_email = explode(',', $email_lists);
                    $cc = $email_cc_lists;
                    $this->cc_email = $cc != '' ? explode(',', $cc) : [];
                } else {
                    $this->support_email = [];
                    $this->cc_email = [];
                }
            } else {
                // Handle the case when no records are found for i_id = 1
                // You might want to throw an exception or log an error
            }
        } catch (\Exception $e) {
            // Handle the database query exception
            // Log or rethrow the exception based on your application's error handling strategy
        }
    }*/
    public function __construct(){

        $this->tbl_configuration_master = config('app.CUSTOM_CONFIG.DB_TABLES.CONFIGURATION_MASTER');

        try {
            $get_emails = DB::table($this->tbl_configuration_master)->where('i_id', 1)->first();

            if (!empty($get_emails)) {
                //$email_lists = $get_emails->email_list;
                $email_cc_lists = $get_emails->email_cc_list;

                $this->noReply = [
                    'email' => env('MAIL_FROM_ADDRESS', ''),
                    'title' => env('MAIL_FROM_NAME', ''),
                ];

                // Support email
                if (env('APP_ENV') == 'local' || strtolower(env('APP_ENV')) == 'uat') {
                    $this->support_email = explode(',', $email_cc_lists);
                    $cc = $email_cc_lists;
                    $this->cc_email = $cc != '' ? explode(',', $cc) : [];
                } else if(env('APP_ENV') == 'DEV' ){
                    $this->support_email = explode(',', $email_cc_lists);
                    $cc = $email_cc_lists;
                    $this->cc_email = $cc != '' ? explode(',', $cc) : [];
                } else if(env('APP_ENV') == 'PROD' ){
                    $this->support_email = explode(',', $email_cc_lists);
                    $cc = $email_cc_lists;
                    $this->cc_email = $cc != '' ? explode(',', $cc) : [];
                } else {
                    $this->support_email = [];
                    $this->cc_email = [];
                }
            } else {
                // Handle the case when no records are found for i_id = 1
                // You might want to throw an exception or log an error
            }
        } catch (\Exception $e) {
            Log::error('Error fetching email configurations: ' . $e->getMessage());
            // Handle the database query exception
            // Log or rethrow the exception based on your application's error handling strategy
        }
    }

    public function sendNotificationMail($info)
    {
        /*try
        {
           $noReply = $this->noReply;
            $subject = $info['subject'];
            
            $mail_data = [
                'name' => $info['name'],
				'email' => $info['email'],
                'body' => isset($info['body']) ? $info['body'] : 'New notification from '.env('APP_NAME').'.'
            ];
           
            Mail::send('emails.notification_template', $mail_data, function($message) use ($mail_data, $noReply, $subject) {
                $message->from($noReply['email'], $noReply['title']);
                if(env('SEND_EMAIL', 'YES') == 'YES')
                {
                    if(env('APP_ENV') == 'PROD') {
                        $message->to($mail_data['email'])->cc($this->cc_email)->subject($subject);
                    } else {
                        $message->to($this->support_email)->cc($this->cc_email)->subject($subject);
                        //$message->to($mail_data['email'])->cc($this->support_email)->subject($subject);
                    }
                }
			});
            
            return true;
			
        } catch (\Exception $ex) {
			#----------------------------------------------
            Log::info('MailDebug::SendEmailCatch => '.$ex->getMessage());  
            #----------------------------------------------
            
            return false;
        }*/
        try {
            $noReply = $this->noReply;
            $subject = $info['subject'];

            $mail_data = [
                'name' => $info['name'],
                'email' => $info['email'],
                'body' => isset($info['body']) ? $info['body'] : 'New notification from ' . env('APP_NAME') . '.',
            ];

            Mail::send('emails.notification_template', $mail_data, function ($message) use ($mail_data, $noReply, $subject) {
                $message->from($noReply['email'], $noReply['title']);
                if (env('SEND_EMAIL', 'YES') == 'YES') {
                    if (env('APP_ENV') == 'PROD') {
                        $message->to($mail_data['email'])->cc($this->cc_email)->subject($subject);
                    } else if (env('APP_ENV') == 'DEV') {
                        $message->to($mail_data['email'])->cc($this->cc_email)->subject($subject);
                        //$message->to($this->support_email)->cc($this->cc_email)->subject($subject);
                    } else {
                        $message->to($this->support_email)->cc($this->cc_email)->subject($subject);
                    }
                }
            });

            return true;

        } catch (\Exception $ex) {
            Log::info('MailDebug::SendEmailCatch => ' . $ex->getMessage());
            return false;
        }
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit