=== Campaign Builder - Subscription Popups, Newsletters, and Auto Responders ===
Contributors: 7thskysoftware
Tags: subscription, newsletter, email marketing, popup, autoresponder
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Build subscription campaigns in WordPress with popup forms, inline forms, subscriber management, newsletters, confirmation emails, and simple auto responder follow-ups.

== Description ==

Campaign Builder (Sky Campaigns) helps site owners collect subscribers and manage basic email campaign activity directly from the WordPress dashboard.

The plugin adds a **Campaigns** admin menu where you can create subscription campaigns, choose popup templates, customize form text and colors, review subscribers, export subscriber lists, send newsletter broadcasts, and create delayed auto responder emails for each campaign.

Sky Campaigns stores campaign and subscriber data in your own WordPress database. Email is sent through WordPress using `wp_mail()`, so delivery depends on your site's mail configuration. For reliable delivery, use a properly configured SMTP or transactional email plugin.

= Main Features =

* Create multiple subscription campaigns.
* Show active campaigns as front-end popups.
* Embed an inline subscription form with the `[skyca_form]` shortcode.
* Choose from six popup templates.
* Customize campaign headline, sub-headline, button text, colors, optional image URL, and optional first name field.
* Use time delay, scroll depth, exit intent, or immediate popup triggers.
* Store subscribers by campaign.
* Search, filter, and export subscribers as CSV.
* Send a configurable confirmation email to new subscribers.
* Create campaign-specific auto responders with day/hour delays and send order.
* Process auto responder queues with WordPress cron.
* Create newsletter drafts and send newsletters immediately to all active subscribers or selected campaigns.
* Use merge tags in confirmation emails, auto responders, and newsletters.
* Include unsubscribe links in newsletter emails.
* Access community support, developer support, and review links from the Support screen.

= Campaigns and Popup Forms =

Each campaign includes a name, description, active/inactive status, popup template, display trigger, and popup settings. Active popup campaigns render on the front end and follow their saved trigger settings.

Available popup templates:

* Classic Clean
* Bold Announcement
* Minimal Slide-in
* Dark Luxury
* Gradient Burst
* Split Panel

Available trigger types:

* Time delay in seconds.
* Scroll depth percentage.
* Exit intent.
* Immediate display.

Popup display is campaign-based. Active popup campaigns are available globally on the front end; the plugin does not currently include per-page targeting controls in the admin interface.

= Inline Form Shortcode =

Use this shortcode to embed a campaign subscription form in posts, pages, widgets, or builder areas that support WordPress shortcodes:

`[skyca_form campaign_id="1"]`

Replace `1` with the ID of an active campaign. The shortcode returns no form if the campaign does not exist or is inactive.

= Subscriber Management =

Subscribers are stored in the WordPress database and linked to the campaign they joined. The Subscribers screen lets you:

* View subscriber email addresses, first names, last names, campaign names, status, and subscription dates.
* Filter subscribers by campaign.
* Search by email, first name, or last name.
* See total and active subscriber counts.
* Export subscribers to CSV.

The public forms collect email address and, when enabled, first name. The database also includes a last name field for compatibility with merge tags and future/custom integrations.

= Confirmation Emails =

When a new subscriber joins a campaign, Sky Campaigns sends a confirmation email using your configured sender details.

From **Campaigns > Settings**, you can set:

* From name.
* From email.
* Confirmation email subject.
* Confirmation email body.

Confirmation emails are sent through `wp_mail()` and use the same HTML email wrapper as newsletter and auto responder messages.

= Auto Responders =

Auto responders are campaign-specific follow-up emails. Each auto responder includes:

* Campaign selection.
* Internal name.
* Email subject.
* HTML body.
* Delay in days.
* Delay in hours.
* Send order.
* Active or inactive status.

When a new subscriber joins a campaign, active auto responders for that campaign are added to the email queue. The queue is processed hourly with WordPress cron, up to 50 pending auto responder emails per run.

= Newsletters =

Newsletters are broadcast emails you can create from the Newsletters screen. Each newsletter includes:

* Internal name.
* Subject.
* HTML body.
* Optional campaign targeting.
* Draft or sent status.
* Sent count and sent date after delivery.

Leave campaign targeting empty to send to all active subscribers, or select one or more campaigns to limit delivery. Newsletters are sent when you choose **Send Now** or **Save & Send Now**. The plugin can save a scheduled date field, but it does not currently include an automated newsletter scheduler.

= Merge Tags =

Use the merge tag picker beside supported subject fields or in the WordPress editor toolbar to insert available tags.

Supported merge tags:

* `{{first_name}}`
* `{{last_name}}`
* `{{email}}`
* `{{blog_name}}`
* `{{blog_url}}`
* `{{date}}`

If a subscriber record does not contain a value, the related merge tag is replaced with an empty value.

= Unsubscribe Handling =

Newsletter emails include an unsubscribe link. When a subscriber uses that link, the plugin marks matching active subscriber records for that email address as unsubscribed and stores an unsubscribe date.

= Privacy and Data =

The plugin does not send subscriber data to an external email marketing service by itself. Messages are sent through WordPress's mail handling. Your hosting provider, SMTP plugin, or transactional mail provider may process outgoing email according to its own terms and privacy policy.

== Installation ==

1. Upload the `sky-campaigns` folder to `/wp-content/plugins/`, or install the plugin ZIP from **Plugins > Add New > Upload Plugin**.
2. Activate **Sky Campaigns** from the WordPress Plugins screen.
3. Open **Campaigns** in the WordPress admin menu.
4. Go to **Campaigns > Campaigns** and create a campaign.
5. Choose a popup template, edit the form text, choose colors, and set a display trigger.
6. Configure sender details and confirmation email content from **Campaigns > Settings**.
7. Use the popup automatically for active campaigns, or embed an inline form with `[skyca_form campaign_id="1"]`.

== Frequently Asked Questions ==

= What does Campaign Builder by Sky Campaigns do? =

It lets you create subscription campaigns, display popup or inline forms, manage subscribers, send confirmation emails, create delayed auto responders, and send newsletter broadcasts from WordPress.

= Does Sky Campaigns send email through an external email service? =

No. The plugin sends email with WordPress `wp_mail()`. For better deliverability, configure SMTP or a transactional mail service on your WordPress site.

= Can I create more than one campaign? =

Yes. You can create multiple campaigns and track subscribers separately for each campaign.

= Can I show a form without a popup? =

Yes. Use `[skyca_form campaign_id="1"]` and replace `1` with your active campaign ID.

= Are popup campaigns shown on specific pages only? =

No. Active popup campaigns are rendered globally on the front end. The current admin interface does not include per-page display targeting.

= Which popup triggers are available? =

Campaigns can use time delay, scroll depth, exit intent, or immediate display.

= Can subscribers join the same campaign more than once? =

No. The subscriber table keeps email addresses unique per campaign. If a previously unsubscribed email subscribes again to the same campaign, the record is reactivated.

= Are confirmation emails sent for every signup? =

A confirmation email is sent for new subscriber records. If an existing subscriber is reactivated, the plugin does not create a new auto responder queue or send a new confirmation email.

= How are auto responders sent? =

Auto responders are queued when a new subscriber joins a campaign. WordPress cron processes pending auto responder emails hourly.

= Can newsletters be scheduled automatically? =

Not in the current version. Newsletters can store a scheduled date value, but delivery happens when you click **Send Now** or **Save & Send Now**.

= Can I send newsletters to selected campaigns? =

Yes. Select one or more campaigns while editing a newsletter. If no campaign is selected, the newsletter sends to all active subscribers.

= Do newsletter emails include an unsubscribe link? =

Yes. Newsletter emails include an unsubscribe link that marks matching active subscriber records for that email address as unsubscribed.

= Can I export subscribers? =

Yes. Use the Subscribers screen to export all subscribers or subscribers filtered by campaign.

= Does the plugin track opens and clicks? =

No open or click tracking is implemented in the current user-facing plugin behavior.

= Which merge tags are supported? =

The supported merge tags are `{{first_name}}`, `{{last_name}}`, `{{email}}`, `{{blog_name}}`, `{{blog_url}}`, and `{{date}}`.

== Screenshots ==

1. Dashboard showing campaign, subscriber, auto responder, and newsletter totals.
2. Campaign list with template, trigger, subscriber count, status, and actions.
3. Campaign editor with popup template selection, form text, colors, image URL, and trigger settings.
4. Subscriber list with campaign filtering, search, counts, and CSV export.
5. Auto responder editor with campaign selection, delay settings, send order, status, subject, and body.
6. Newsletter editor with campaign targeting, subject, body, scheduled date field, and send actions.
7. Settings screen with sender details, confirmation email editor, merge tag picker, and shortcode reference.
8. Support screen with community support, developer support, and review links.

== Changelog ==

= 1.0.1 =
* Added a merge tag picker modal for confirmation emails, auto responders, and newsletters.
* Added tag icon controls beside email subject fields and in WordPress editor toolbar areas.
* Improved email editing workflow by inserting selected merge tags into the active subject or body field.
* Added a custom Sky Campaigns admin footer review link on plugin admin pages.

= 1.0.0 =
* Initial public release.

== Upgrade Notice ==

= 1.0.1 =
Adds merge tag picker controls for supported email editors and a Sky Campaigns review link in the plugin admin footer.

= 1.0.0 =
Initial public release of Sky Campaigns.
