public function sendEmailToSuperAdmins($subject, $event, $emailBladeFile) {

        // Grab the super administrators who need to be notified from the config settting
        $superAdminEmails = config('auth_frontend_registration_successful_admins_who_receive_notification_email');

        // If there are no super administrators who are specified in the config setting, use the first-among-equals admin
        if (count($superAdminEmails) == 0) {
            $superAdminEmails[] = config('lasallecmsusermanagement.administrator_first_among_equals_email');
        }

        // create data array from the event DTO
        $data = $event->data;

        // Set the data needed to send the email
        $data['subject']   = $subject;
        $data['site_name'] = config('lasallecmsfrontend.site_name');

        // data used in the body of the email, in the blade file
        $data['data']['site_name'] = config('lasallecmsfrontend.site_name');
        $data['data']['id']        = $event->data['id'];

        // Send the notification email to each specified super administrator
        foreach ($superAdminEmails as $superAdminEmail) {

            // ensure that this email is a super admins
            if (!$this->isSuperAdministrator($superAdminEmail)) {
                continue;
            }

            // set the "to" email field
            $data['to'] = $superAdminEmail;

            Mail::queue($emailBladeFile, $data, function ($message) use ($data) {
                $message->subject($data['subject'])
                        ->to($data['to'])
            ;
            });
        }
    }
public function sendEmailToSuperAdmins($subject, $event, $emailBladeFile) {

        // Grab the super administrators who need to be notified from the config settting
        $superAdminEmails = config('auth_frontend_registration_successful_admins_who_receive_notification_email');

        // If there are no super administrators who are specified in the config setting, use the first-among-equals admin
        if (count($superAdminEmails) == 0) {
            $superAdminEmails[] = config('lasallecmsusermanagement.administrator_first_among_equals_email');
        }

        // create data array from the event DTO
        $data = $event->data;

        // Set the data needed to send the email
        $data['subject']   = $subject;
        $data['site_name'] = config('lasallecmsfrontend.site_name');

        // data used in the body of the email, in the blade file
        $data['data']['site_name'] = config('lasallecmsfrontend.site_name');
        $data['data']['id']        = $event->data['id'];

        // Send the notification email to each specified super administrator
        foreach ($superAdminEmails as $superAdminEmail) {

            // ensure that this email is a super admins
            if (!$this->isSuperAdministrator($superAdminEmail)) {
                continue;
            }

            // set the "to" email field
            $data['to'] = $superAdminEmail;

            Mail::queue($emailBladeFile, $data, function ($message) use ($data) {
                $message->subject($data['subject'])
                        ->to($data['to'])
            ;
            });
        }
    }
public function sendEmailToSuperAdmins ( $ subject , $ event , $ emailBladeFile ) { // Grab the super administrators who need to be notified from the config settting $ superAdminEmails = config ( 'auth_frontend_registration_successful_admins_who_receive_notification_email' ) ; // If there are no super administrators who are specified in the config setting, use the first-among-equals admin if ( count ( $ superAdminEmails ) == 0 ) { $ superAdminEmails [ ] = config ( 'lasallecmsusermanagement.administrator_first_among_equals_email' ) ; } // create data array from the event DTO $ data = $ event -> data ; // Set the data needed to send the email $ data [ 'subject' ] = $ subject ; $ data [ 'site_name' ] = config ( 'lasallecmsfrontend.site_name' ) ; // data used in the body of the email, in the blade file $ data [ 'data' ] [ 'site_name' ] = config ( 'lasallecmsfrontend.site_name' ) ; $ data [ 'data' ] [ 'id' ] = $ event -> data [ 'id' ] ; // Send the notification email to each specified super administrator foreach ( $ superAdminEmails as $ superAdminEmail ) { // ensure that this email is a super admins if ( ! $ this -> isSuperAdministrator ( $ superAdminEmail ) ) { continue ; } // set the "to" email field $ data [ 'to' ] = $ superAdminEmail ; Mail :: queue ( $ emailBladeFile , $ data , function ( $ message ) use ( $ data ) { $ message -> subject ( $ data [ 'subject' ] ) -> to ( $ data [ 'to' ] ) ; } ) ; } }
Send email notifications to the super admins

@param  text   $subject         Email subject
@param  object $event           Data object from event DTO
@param  text   $emailBladeFile  Full package::path..blade.file
@return void
Send email notifications to the super admins