MAILPILOT — LARAVEL 12 EMAIL MARKETING APP
============================================

Requirements
------------
- cPanel hosting with PHP 8.3 (or compatible PHP 8.2+), MySQL/MariaDB, and the PHP extensions listed by Laravel.
- PHP functions checkdnsrr and mail transport sockets enabled by the host.

Upload and install (cPanel only)
---------------------------------
1. Upload this archive to cPanel File Manager and extract it at:
   /home/npspzdyalc/greatgleninc.online/email-marketing
   The folder containing artisan, app, vendor, and .env is the project root.
2. If cPanel does not allow changing the domain document root, copy the contents of the project's public folder (index.php, .htaccess, and css/) into:
   /home/npspzdyalc/greatgleninc.online
   Use the included public/index.php paths for the email-marketing folder. The domain folder then acts as the public folder.
   If cPanel does allow changing the document root, use:
   /home/npspzdyalc/greatgleninc.online/email-marketing/public
3. Copy .env.example to .env and edit it in File Manager. Set APP_URL to the real https URL, APP_KEY to the included generated key (or generate one only if your host provides Terminal), and set:
   DB_CONNECTION=mysql
   DB_HOST=127.0.0.1
   DB_PORT=3306
   DB_DATABASE=your_cpanel_database
   DB_USERNAME=your_cpanel_database_user
   DB_PASSWORD=your_database_password
   SESSION_DRIVER=database
   CACHE_STORE=file
4. In cPanel > MySQL Databases, create the database and user and grant ALL PRIVILEGES.
5. Open phpMyAdmin, select the new database, choose Import, and import schema.sql. This creates all tables and the admin account.
6. Edit .env mail values only as a fallback; SMTP settings are normally entered inside the admin panel. Save the file, then visit https://your-domain.example/login.
7. Log in with:
   Email: admin@example.com
   Password: password
   Change this password immediately by editing the users table in phpMyAdmin or adding a password-management package before production use.

Cron (required)
--------------
In cPanel > Cron Jobs, this host allows no more often than every 5 minutes. Choose Once Per Five Minutes, or enter Minute */5, with Hour/Day/Month/Weekday all *. Use this command:
/opt/cpanel/ea-php83/root/usr/bin/php /home/npspzdyalc/greatgleninc.online/email-marketing/artisan schedule:run >> /home/npspzdyalc/greatgleninc.online/email-marketing/storage/logs/cron.log 2>&1
If that PHP path is unavailable, use /usr/local/bin/php at the start of the same command.
The project sends messages at the configured interval after each scheduler start; set Send interval to 5 seconds for this host.
The scheduler calls campaign:send, respects the pause toggle, sends pending subscribers, sleeps for the configured interval, and records sent/failed rows.

Important operational notes
---------------------------
- The app validates email syntax and performs an MX lookup. Some shared hosts disable DNS functions; in that case valid addresses may be skipped until the host enables checkdnsrr.
- Keep the From address aligned with the SMTP account and configure SPF/DKIM/DMARC in DNS for deliverability.
- Never commit .env or disclose SMTP passwords. Back up the database before bulk deletion.
- The subscriber dashboard uses separate forms, a Yes/No confirmation modal for selected deletion and clearing all subscribers, and a protected POST route for destructive actions.
- Vendor dependencies are included in this archive; no Composer or terminal access is required on cPanel.
