=== Dropndot Email Subscriptions and Newsletters ===
Contributors: dropndot
Tags: newsletter, subscription, email, mailing-list, graphql
Requires at least: 6.3
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Email subscriptions and newsletters with GraphQL support, email confirmations, and an admin interface.

== Description ==

Dropndot Email Subscriptions and Newsletters is a full-featured email subscription and newsletter plugin for WordPress. Collect subscribers with double or single opt-in, manage them from a dedicated admin dashboard, send newsletters, and integrate with headless frontends via REST API or GraphQL.

= Core Features =

* Double opt-in and single opt-in subscription modes
* Customizable confirmation, welcome, and unsubscribe email templates
* One-click unsubscribe with optional confirmation emails
* Admin dashboard with statistics, search, filters, and bulk actions
* CSV export with geolocation data (country, region)
* Subscription form shortcode with customizable appearance

= Advanced Features =

* Google reCAPTCHA v2 and v3 spam protection (optional)
* IP-based rate limiting
* Automatic geolocation via ipinfo.io
* Custom confirmation and unsubscribe pages
* Admin email notifications for new subscriptions and unsubscribes
* REST API for full CRUD operations
* GraphQL support (requires the [WPGraphQL](https://wordpress.org/plugins/wp-graphql/) plugin)
* Headless frontend integration for Next.js and React applications
* AJAX-powered admin interface

= Email Newsletter Features =

* Email template management with TinyMCE editor
* Send newsletters immediately or schedule for future delivery
* Country-based subscriber filtering
* Batch processing for large subscriber lists (10,000+)
* Real-time progress tracking during sends
* Complete sending history with statistics
* HTML emails optimized for major email clients

= Shortcodes =

* `[dropemsu_form]` — Display a subscription form (optional `title` and `button_text` attributes).
* `[dropemsu_confirmation_status]` — Show confirmation status on a custom confirmation page.
* `[dropemsu_unsubscribe_status]` — Show unsubscribe status on a custom unsubscribe page.

= REST API =

All routes are registered under the `dropemsu-manager/v1` namespace and include endpoints for listing, creating, updating, deleting, confirming, and unsubscribing.

== Installation ==

1. Upload the `dropemsu-manager` folder to the `/wp-content/plugins/` directory, or install through the **Plugins > Add New** screen in WordPress.
2. Activate the plugin through the **Plugins** menu.
3. Go to **Subscriptions > Settings** to configure subscription, email, security, and API options.
4. Add the `[dropemsu_form]` shortcode to any page or post to display a subscription form.

Upon activation, the plugin creates the required database tables and sets default options automatically.

== Frequently Asked Questions ==

= How do I enable double opt-in? =

Go to **Subscriptions > Settings > Subscription** and enable **Require Email Confirmation**.

= Can I use this with a Next.js or React frontend? =

Yes. Enable **Frontend Integration** under **Subscriptions > Settings > API & Info** and use the REST API endpoints from your headless application.

= Does this work with WPGraphQL? =

Yes, when the [WPGraphQL](https://wordpress.org/plugins/wp-graphql/) plugin is installed. Enable GraphQL under **Subscriptions > Settings > API & Info**.

= How do I customize email templates? =

For confirmation, welcome, and unsubscribe emails, go to **Subscriptions > Settings > Emails**. For newsletters, go to **Subscriptions > Email Newsletter > Templates**.

= Can I export subscriptions? =

Yes. Use the **Export to CSV** button on the Subscriptions admin page. Exports include geolocation data.

= Is reCAPTCHA required? =

No. reCAPTCHA is optional and can be enabled under **Subscriptions > Settings > Security**.

= Does the plugin work with SMTP plugins? =

Yes. The plugin uses WordPress's standard `wp_mail()` function and works with any SMTP or mail delivery plugin.

= How do I send newsletters? =

Go to **Subscriptions > Email Newsletter**, create or select a template, choose your audience (all subscribers or by country), and send immediately or schedule for later.

== External services ==

This plugin may connect to third-party services when the related features are enabled:

**ipinfo.io** (Geolocation)

* Used to detect subscriber country and region from IP address during subscription.
* Data sent: visitor IP address.
* [Terms of Service](https://ipinfo.io/terms-of-service)
* [Privacy Policy](https://ipinfo.io/privacy-policy)

**Google reCAPTCHA** (Spam protection, optional)

* Used when reCAPTCHA is enabled in plugin settings.
* Data sent: information required by Google reCAPTCHA to verify submissions.
* [Terms of Service](https://policies.google.com/terms)
* [Privacy Policy](https://policies.google.com/privacy)

== Changelog ==

= 1.0.2 =

* Renamed generic prefixes to unique `dropemsu_` / `DROPEMSU_` namespace (options, AJAX actions, script handles, nonces, cron hooks, and JavaScript objects)
* Sanitized and validated all superglobal input through helper methods with proper unslashing
* Migrated legacy `subscription_*` options automatically for existing installations
* Removed legacy generic shortcode aliases (`subscription_form`, etc.) — use `dropemsu_form`, `dropemsu_confirmation_status`, and `dropemsu_unsubscribe_status`

= 1.0.1 =

* Renamed plugin to Dropndot Email Subscriptions and Newsletters for WordPress.org directory compliance
* Prefixed AJAX action hooks; legacy action names remain supported for backward compatibility
* Moved admin inline CSS and JavaScript to enqueued assets
* Secured REST GraphQL endpoint with operation-based permission checks
* Added missing REST unsubscribe handler

= 1.0.0 =

* Initial release
* Double opt-in and single opt-in subscription modes
* Customizable confirmation, welcome, and unsubscribe email templates
* Admin dashboard with statistics, search, filters, bulk actions, and CSV export
* Email newsletter system with templates, scheduling, and batch processing
* REST API and GraphQL support (WPGraphQL required for GraphQL)
* Headless frontend integration for Next.js and React
* Google reCAPTCHA v2 and v3 support
* IP-based rate limiting and geolocation via ipinfo.io
* Custom confirmation and unsubscribe pages
* Admin notifications for new subscriptions and unsubscribes
* Subscription form shortcodes with customizable design

== Upgrade Notice ==

= 1.0.2 =
WordPress.org review compliance update. Settings migrate automatically from legacy option keys. Shortcode aliases remain supported.

= 1.0.1 =
WordPress.org review compliance update. All stored option keys, database tables, and shortcodes are unchanged.

= 1.0.0 =
Initial release of Dropndot Email Subscriptions and Newsletters.
