=== One Two Three Send ===
Contributors: onetwothreesend
Tags: newsletter, email, ai, subscribers, claude
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.1
Stable tag: 2.0.9
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI newsletters for WordPress. Draft with Claude, audit before sending, deliver via Resend or SMTP, manage subscribers — all from your admin.

== Description ==

One Two Three Send is a complete newsletter workflow inside WordPress. The plugin uses the Claude API (you supply the key) to draft issues from your site's content, gives you inline AI editor tools to polish the copy, runs a pre-send audit to catch common mistakes, and sends through Resend or SMTP to subscribers stored in your own database.

= What's included =

* **AI newsletter generator** — Claude drafts a newsletter from your recent posts, site tagline, and a manual description you provide. Tone selector (Friendly / Professional / Casual / Authoritative) and length selector (~200, ~400, ~700 words).
* **AI editor** — select any paragraph and click Rewrite, Shorten, Expand, or Fix grammar. Generate 5 alternative subject lines in one click. Tone check, local spam-word scan.
* **Pre-send audit** — one click runs 10 checks: subject length, body word count, unsubscribe reference, link count, link format, spam triggers, placeholder leaks, readability (Flesch-Kincaid), read time, structural sanity. Each check returns pass / warn / fail with a plain-language explanation.
* **Scheduling** — manual, daily, weekly, fortnightly, monthly. Manual-approval mode emails the admin before any send. Auto-send is opt-in.
* **Email delivery** — Resend (API) or SMTP (any provider).
* **Subscribers** — local database with filtering, CSV export, one-click token-based unsubscribe.
* **Signup forms** — inline form via shortcode `[otts_form id="1"]`, Gutenberg block, or PHP `onetwothreesend_render_form(1)`.
* **Welcome email** — automatic, configurable subject and body with `{first_name}`, `{email}`, `{site_name}`, `{from_name}` placeholders.
* **Lead magnet delivery** — upload a PDF, zip, or any allowed file. New subscribers receive a signed, time-limited download link in the welcome email. Expired links auto-refresh when clicked, no manual resending.

= External services =

This plugin calls the following external APIs using credentials you provide. No data is sent to any third party without you entering a key first.

* **Anthropic Claude API** (`api.anthropic.com`) — for drafting and editing newsletters. You provide the API key in Settings → AI. Terms: https://www.anthropic.com/legal/consumer-terms. Privacy: https://www.anthropic.com/legal/privacy.
* **Resend** (`api.resend.com`) — optional, for email delivery. You provide the API key in Settings → Email Provider if you choose Resend. Terms: https://resend.com/legal/terms-of-service. Privacy: https://resend.com/legal/privacy-policy.

The plugin itself does not phone home. It does not contact onetwothreesend.com or any server other than the ones you explicitly configure above.

= Companion plugin =

A companion plugin (One Two Three Send Pro, distributed separately) can extend this with Stripe paywalls, Mailchimp / MailerLite / Brevo / ConvertKit providers, popup and slide-in forms, and more. One Two Three Send is fully functional on its own — the companion plugin is optional. [Pricing and details](https://onetwothreesend.com/pricing/).

= Useful links =

* [Features overview](https://onetwothreesend.com/features/) — full feature breakdown with screenshots.
* [Documentation](https://onetwothreesend.com/docs/) — setup walkthroughs and troubleshooting guides.
* [Pricing](https://onetwothreesend.com/pricing/) — free tier, monthly, annual, and founder plans for the companion newsletter and pro plugin.
* [Privacy policy](https://onetwothreesend.com/privacy/).
* [Contact / support](https://onetwothreesend.com/contact/) — for questions the FAQ below doesn't answer.

== Installation ==

1. Upload the plugin zip from Plugins → Add New → Upload Plugin, then activate.
2. Newsletter → Settings → Email Provider → connect Resend or SMTP.
3. (Optional) Newsletter → Settings → AI → paste your Claude API key (get one at console.anthropic.com) if you want the AI drafting + editing features. The plugin also works without a key — you can write newsletters yourself.
4. Newsletter → New Newsletter → write or generate, edit, run the audit, send.

== Frequently Asked Questions ==

= Do I need a Claude API key? =

No — the plugin works fine without one if you write newsletters yourself. The AI features (Generate, Rewrite, Shorten, Expand, Fix grammar, subject-line suggestions, tone check) are all optional and only run when you click them. Without a key, you can still write a newsletter directly in the editor, run the pre-send audit, schedule it, and send to your subscribers.

If you want the AI features, get a key at console.anthropic.com — free to sign up, pay-per-token usage — and paste it into Newsletter → Settings → AI.

= Can I use a different email provider than Resend or SMTP? =

Out of the box, no — the free plugin supports Resend and SMTP. The companion pro plugin adds Mailchimp, MailerLite, Brevo, and ConvertKit. Developers can also add providers by hooking the `otts_make_provider` filter.

= Is my subscriber data stored anywhere outside my site? =

No. Subscribers live in your own WordPress database (`wp_otts_subscribers`). Unsubscribe is one-click via a token in the email footer — no login required.

= What happens to my data if I delete the plugin? =

By default, your subscriber list, newsletter drafts, and settings are preserved. If you tick "Delete data on uninstall" in Settings → Advanced before deleting, the plugin drops its tables and removes all options.

= Does the plugin work with cache plugins? =

Yes. The signup form uses a honeypot for spam protection instead of a nonce, so it is cache-safe.

== Screenshots ==

1. Dashboard — subscriber totals, next scheduled send, and recent newsletters at a glance.
2. New Newsletter — pick a tone and length, then one click has Claude draft from your site's recent posts and manual description.
3. Subscribers — filter by status, search by email or name, export the full list to CSV. Every subscriber gets a one-click unsubscribe token in the email footer.
4. Edit Newsletter — subject line, body editor, and an AI sidebar with Rewrite, Shorten, Expand, Fix grammar, Suggest subject lines, Spam check, and Tone check. Send or preview from the same screen.
5. Pre-send audit — one click runs ten checks against the draft (subject length, body word count, unsubscribe reference, link count, link format, spam triggers, placeholder leaks, readability, read time, structure). Each check returns pass / warn / fail with a plain-language note.
6. Signup Forms — visual form builder with a live preview. Embed anywhere via shortcode, Gutenberg block, or PHP helper.

== Changelog ==

= 2.0.9 =
* Welcome email body now supports rich HTML — paste headings, lists, emoji links, and CTA buttons into the body field at Newsletter → Settings → Welcome Email and they render. Bodies without any HTML tags still get the previous plain-text + wpautop treatment, so existing setups carry over unchanged.

= 2.0.8 =
* Signup forms gained a "Redirect after signup" field (Newsletter → Signup Forms → edit form). When set, the subscriber is redirected to that URL after a successful signup instead of seeing the inline success message. The token `{email}` in the URL is replaced with the URL-encoded email so a follow-up page (e.g. a Stripe-checkout pricing page) can pre-fill the address. Leave blank to keep the existing inline-message behaviour.

= 2.0.7 =
* Docs: added a "Useful links" section in the Description with pointers to the features overview, documentation, pricing, privacy policy, and contact page on onetwothreesend.com. No code changes.

= 2.0.6 =
* Docs: clarified that the Claude API key is OPTIONAL — the plugin works fine for hand-written newsletters without it. The AI features (Generate, Rewrite, Shorten, Expand, Fix grammar, subject suggestions, tone check) only run when you click them, so a key is only needed if you want them. Updated the FAQ and install steps accordingly.

= 2.0.3 =
* Newsletters can now be marked Free or Paid from the edit screen. Free is the default and sends the full body to every active subscriber. The companion pro plugin applies the paywall when the mode is Paid.
* Added filter `otts_send_recipients` so pro-plugin Stripe paywall can segment free vs paid subscribers per newsletter.
* Added filter `otts_render_for_subscriber` so pro-plugin paywall can substitute a teaser + Subscribe CTA when a free subscriber receives a paid-newsletter send.
* Added extension points on the Settings page: `otts_settings_tabs` filter, `otts_render_settings_tab_{tab}` and `otts_save_settings_{tab}` actions, so companion plugins can add their own tabs without modifying free-plugin files.

= 2.0.2 =
* Fix: differentiated Plugin URI and Author URI in the plugin header as required by the wordpress.org submission check.

= 2.0.1 =
* wordpress.org compliance pass based on Plugin Check report.
* Added translator comments to every translatable string with placeholders.
* Ordered placeholders (`%1$s`, `%2$s`) in strings with multiple values.
* Switched file operations to WP_Filesystem-aligned helpers (`wp_handle_upload`, `wp_delete_file`).
* Tightened `$_POST` / `$_GET` sanitization pipeline (`wp_unslash` → `sanitize_*`).
* Subscriber database queries now pass through `$wpdb->prepare()` end-to-end.
* Removed legacy `load_plugin_textdomain()` call; WP 4.6+ auto-loads translations.

= 2.0.0 =
* Major refactor for wordpress.org submission.
* Removed license-gating system — all advertised features work out of the box.
* Removed phone-home license validation.
* Extended Phase 2 features (Stripe paywall, additional email providers, popup/slide-in forms) are now in a separate companion plugin.
* Added filter hooks for companion plugins: `otts_form_types`, `otts_provider_choices`, `otts_make_provider`, `otts_editor_action`, `otts_audit_checks`.
* Cleaner settings UI — Claude API key moved from Advanced to a dedicated AI tab.

= 1.0.6 =
* Merged lead-magnet delivery into the welcome email (one email per signup instead of two).
* Expired download links now auto-regenerate and email a fresh link when clicked.
* Default download link expiry bumped to 365 days.

= 1.0.5 =
* Improved default welcome email copy.
* New `{from_name}` placeholder for email templates.

= 1.0.4 =
* Signup form is now cache-safe — swapped the nonce for a honeypot.

= 1.0.3 =
* Lead Magnet feature — upload a file, new subscribers receive a signed, time-limited download link.

= 1.0.2 =
* Welcome email on signup.
* Pre-send audit with 10 checks.
* Reorganised settings tabs.

= 1.0.1 =
* Hotfix for edit-newsletter page permissions.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 2.0.3 =
Adds Free / Paid toggle on newsletters and two extensibility filters used by the pro plugin's Stripe paywall. No change if you only send free newsletters.

= 2.0.2 =
Submission fix — Plugin URI and Author URI now differ. No functional changes.

= 2.0.1 =
Compliance pass for wordpress.org — i18n, sanitization, SQL preparation. No functional changes.

= 2.0.0 =
Major update: license-gating removed; premium features moved to a separate companion plugin. Existing drafts, subscribers, and settings are preserved.
