=== AddonLogic Booking Reminder Emails ===
Contributors: snehalpancholi
Tags: booking, appointments, reminder, email, cron, notification, schedule
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically send scheduled reminder emails before appointments via WP Cron. Manage appointments via a custom post type with customisable email templates and reminder timing.

== Description ==

AddonLogic Booking Reminder Emails is a standalone appointment reminder system for WordPress. It adds a dedicated Appointments CPT where admins can log client bookings. A WP Cron job runs hourly and automatically dispatches beautifully formatted HTML reminder emails to clients before their appointments.

No third-party services required — everything runs on your WordPress site using native WP Cron and wp_mail().

**Key Features:**

* Custom Post Type (bre_appointment) with client name, email, appointment date/time, service description, and internal notes.
* Fully configurable reminder timing — set first reminder X hours before the appointment (e.g. 24h, 48h).
* Optional second reminder at a different lead time (e.g. 2h before).
* Customisable HTML email template with live placeholders: {client_name}, {service}, {appointment_date}, {appointment_time}, {site_name}.
* Custom sender name and email address.
* Optional BCC copy to admin on every outgoing reminder.
* Full reminder log with per-entry status (sent/failed), appointment link, client email, and type (first/second).
* Test email button to preview output to admin inbox.
* Manual "Run Now" trigger for immediate dispatch check.
* Reset Reminder Flags button per appointment — useful after rescheduling.
* Self-hosted automatic updates via the AddonLogic update server.

== Installation ==

1. Upload the `booking-reminder-emails` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **Settings > Booking Reminders** to configure timing, sender info, and the email template.
4. Add your first appointment under **Appointments > Add New**.
5. WP Cron will automatically dispatch reminders at the configured lead time.

== Frequently Asked Questions ==

= Does this work without a cron plugin? =

Yes. It uses WordPress's built-in WP Cron, which runs on the next page load after the scheduled time. For time-sensitive reminders on low-traffic sites, consider setting up a real system cron to trigger `wp-cron.php` every 5 minutes.

= What email format is used? =

HTML emails with an inline-styled, responsive template. The template is fully editable from the settings page.

= Can I send reminders to multiple clients? =

Each Appointment post has one client email. For group bookings, create one Appointment post per client.

= What happens when I delete a reminder appointment? =

The appointment post and all its meta are deleted. The log entry for reminders already sent remains in the log table unless you clear the log separately.

= Where is reminder data stored? =

Appointment details are stored as post meta on `bre_appointment` posts. Reminder logs are stored in a custom DB table (`{prefix}addlc_bre_log`).

= How do I reset a reminder after rescheduling an appointment? =

Open the appointment, scroll to the "Reminder Status" section in the meta box, and click **Reset Reminder Flags**. The cron job will send fresh reminders at the next check.

== Screenshots ==

1. Appointments list — shows client name, email, appointment date/time, service, and reminder sent status.
2. Appointment edit screen — meta box with client details, datetime picker, and status display.
3. Settings page — reminder timing, sender info, and full HTML email template editor.
4. Reminder log page — paginated table of all sent reminders with status badges and appointment links.
5. Default email template rendered in a mail client — responsive, branded layout.

== Changelog ==

= 1.0.0 =
* Initial release.
* Custom Post Type bre_appointment.
* WP Cron-based hourly reminder dispatch.
* First and optional second reminder support.
* Configurable HTML email template with placeholders.
* Custom sender name and email.
* Admin BCC option.
* Reminder log with pagination and clear functionality.
* Test email and manual run trigger.
* Reset Reminder Flags per appointment.
* Self-hosted update check via AddonLogic update server.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
