=== Newsletter Signup ===
Contributors: snehalpancholi
Tags: newsletter, email, subscribe, opt-in, mailing list
Requires at least: 6.0
Tested up to: 6.7
Stable tag: 1.0.0
Requires PHP: 8.1
License: GPL-2.0+
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Email capture form with double opt-in, unsubscribe links, and CSV export. No third-party service required.

== Description ==

Newsletter Signup lets you add an email capture form anywhere on your site using the `[newsletter]` shortcode. Subscribers are stored directly in your WordPress database — no SaaS account or API key required.

**Key features:**

* Drop-in shortcode — `[newsletter]` works on any page, post, or widget
* Optional name field — collect first name alongside email
* Double opt-in — sends a confirmation email before adding the subscriber
* Unique token system — each subscriber has a secure 64-character token for confirmation and unsubscribe links
* Welcome email — sent automatically after confirmation (or immediately when opt-in is disabled)
* Unsubscribe links — every welcome email includes a one-click unsubscribe link
* Subscriber management — filter by status, search by email, delete individual or bulk
* CSV export — download your entire subscriber list at any time
* Rate limiting — honeypot spam trap + IP-based rate limiting (max 3 per hour)
* No jQuery — lightweight vanilla ES6 JavaScript

== Installation ==

1. Upload the `newsletter-signup` folder to `/wp-content/plugins/`.
2. Activate the plugin from **Plugins > Installed Plugins**.
3. Go to **Settings > Newsletter** to configure sender details and email templates.
4. Add `[newsletter]` to any post, page, or widget.

== Frequently Asked Questions ==

= Does this require a third-party email service? =
No. All emails are sent through WordPress's built-in `wp_mail()` function using your server's mail system or any SMTP plugin you have installed.

= Where are subscribers stored? =
In a custom database table `{prefix}nls_subscribers` in your WordPress database.

= Can I export my subscribers? =
Yes. Go to **Tools > Subscribers** and click **Export CSV**.

= What happens when someone unsubscribes? =
Their record is updated to `unsubscribed` status. They are not deleted, which prevents accidental re-subscription from cached form submissions. You can manually delete unsubscribed records from the admin.

= Is the form accessible? =
Yes. The form uses proper labels with `screen-reader-text`, ARIA live regions for response messages, and `aria-hidden` for the honeypot field.

= Can I translate the plugin? =
Yes. All strings are wrapped in translation functions. Place your `.po` / `.mo` files in `/languages/` using the text domain `newsletter-signup`.

== Screenshots ==

1. **Front-end form** — Clean email capture form rendered by the [newsletter] shortcode.
2. **Settings page** — Configure double opt-in, sender details, and email templates.
3. **Subscribers list** — Filter, search, delete, and export your subscriber list.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
