=== DigiLucks Mailer ===
Contributors: appnly
Tags: smtp, email, deliverability, contact form, turnstile
Requires at least: 5.7
Tested up to: 7.1
Requires PHP: 7.2
Stable tag: 1.7.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send your WordPress emails through an authenticated relay so contact-form queries and notifications reach the inbox, not spam. With a usage dashboard.

== Description ==

By default WordPress sends email with PHP's `mail()`, which is unauthenticated, so contact-form queries, order notices and password resets often land in spam or vanish. DigiLucks Mailer reroutes every email your site sends through an authenticated DigiLucks relay so it actually reaches the inbox.

* One setting to switch on. Paste your API key, enable, done.
* Works with any form or plugin that uses `wp_mail()` (Contact Form 7, WPForms, Elementor forms, WooCommerce, and more).
* Sets a Reply-To of your choosing so replies come straight to your inbox.
* A dashboard in wp-admin showing how many emails were sent, delivered and failed, plus your remaining quota.
* Optional fallback: if the relay is ever unreachable, WordPress sends the email the normal way so nothing is lost.
* Built-in contact form: drop [digilucks_contact_form] on any page for a Name/Email/Phone/Message form with optional Cloudflare Turnstile spam protection.

Sending is metered by a monthly quota tied to your DigiLucks account. A free tier is included; paid plans add more volume.

== Installation ==

1. Install and activate the plugin.
2. Create an account at https://mailer.digilucks.com and copy your API key.
3. In wp-admin go to **DigiLucks Mailer &rarr; Settings**, paste the API key, set your From name and Reply-To, tick **Enable relay**, and save.
4. Send a test email (any contact-form submission works) and watch it appear on the **Dashboard**.

== External services ==

This plugin connects to the DigiLucks Mailer service (https://mailer.digilucks.com), an external service operated by DigiLucks, to send your site's email through an authenticated relay and to show usage statistics.

What is sent, and when:

* When your site sends an email (any `wp_mail()` call, e.g. a contact-form submission) and the relay is enabled, the plugin sends that email's recipient address, subject, message body, chosen From name, Reply-To address, and your site's URL to `https://mailer.digilucks.com/api/relay/send`, authenticated with your API key. This is required to deliver the email.
* When you open the plugin dashboard in wp-admin, the plugin requests `https://mailer.digilucks.com/api/relay/stats` with your API key to display your quota and recent-send counts.

No data is sent until you enter an API key and enable the relay. If the relay is disabled, WordPress sends email normally and nothing is transmitted to DigiLucks.

Service Terms of Use: https://mailer.digilucks.com/terms
Service Privacy Policy: https://mailer.digilucks.com/privacy

This plugin also uses Cloudflare Turnstile (https://www.cloudflare.com/products/turnstile/), a third-party service by Cloudflare, Inc., to protect the built-in contact form from spam and bots. It is optional and only active if you enter your own Turnstile keys in the plugin settings.

What is sent, and when:

* When the built-in contact form ([digilucks_contact_form]) is displayed on a page and Turnstile keys are set, the plugin loads Turnstile's script (https://challenges.cloudflare.com/turnstile/v0/api.js) in the visitor's browser, which shows the anti-spam widget.
* When that form is submitted, the plugin sends the Turnstile response token, your Turnstile secret key, and the visitor's IP address to `https://challenges.cloudflare.com/turnstile/v0/siteverify` to verify the submission is human. This happens only on form submission.

No Turnstile data is sent if you leave the Turnstile keys blank.

Cloudflare Terms of Service: https://www.cloudflare.com/website-terms/
Cloudflare Privacy Policy: https://www.cloudflare.com/privacypolicy/

== Frequently Asked Questions ==

= Do I need my own SMTP server? =
No. DigiLucks runs the authenticated sending infrastructure for you.

= Will my emails come from my own address? =
The visible sender is the DigiLucks relay mailbox; your address is set as Reply-To, so replies reach you. Custom sending domains are on the roadmap.

= Can my provider set this up for me so I don't handle the key? =
Yes. A provider can add `define( 'DIGILUCKS_MAILER_KEY', 'your-key' );` to your site's wp-config.php. The plugin then uses that key, enables sending automatically, and the key is never shown or editable in your admin, you just pay and use it.

= What happens when I run out of quota? =
New emails are held until you upgrade your plan or the monthly quota resets. Enable the fallback option to have WordPress deliver them normally in the meantime.

== Changelog ==

= 1.7.5 =
* New: a "Check for updates" button on the dashboard that forces WordPress to look for a new version, and shows whether you are up to date.

= 1.7.4 =
* The monthly quota progress bar now shows on every plan, including Free.

= 1.7.3 =
* New: a "Spam blocked" counter on the dashboard showing how many bot/spam submissions the contact form stopped.

= 1.7.2 =
* Housekeeping: plugin author label.

= 1.7.1 =
* New: a Help & Setup page in wp-admin with quick-start steps, contact-form shortcode reference, plan/quota info and FAQs.

= 1.7.0 =
* Styles and scripts are now loaded via the WordPress enqueue APIs. Documented Cloudflare Turnstile as an external service.

= 1.6.5 =
* Dashboard shows a plan chooser (current plan + upgrade cards) so clients can self-serve upgrades.

= 1.6.4 =
* Upgrade buttons use a stable link that always points to the current plan.

= 1.6.3 =
* Pro plan is now /mo.

= 1.6.2 =
* Fixed the admin menu icon (now a small crisp DigiLucks mark instead of an oversized image).

= 1.6.1 =
* Premium, branded query email (logo header, colored table, clickable email/phone, reply button, timestamp). Logo used as the admin menu icon.

= 1.6.0 =
* Form builder: create multiple named forms (Forms menu), pick their fields, set per-form recipient, subject, reply-to and thank-you message. Each gets a shortcode [digilucks_contact_form id="N"]. Limits: 3 forms on Starter, 7 on Pro.

= 1.5.2 =
* Redesigned Settings page: colorful header, sectioned layout, rounded fields, professional look.

= 1.5.1 =
* Optional logo at the top of the query and auto-reply emails (Email logo URL setting).

= 1.5.0 =
* Contact form: add your own fields (extra=""), hide built-in ones (hide=""), editable query subject, and an optional auto-reply to the visitor. Success screen now shows a thank-you with an 'Okay, Thank you' button that brings the form back. DigiLucks logo added to the dashboard.

= 1.4.4 =
* Stability: removed the Elementor widget integration. Upgrade button now opens PayPal checkout directly.

= 1.4.3 =
* New: native Elementor widget 'DigiLucks Contact Form' (drag-and-drop) in addition to the shortcode.

= 1.4.2 =
* Restyled the contact form (First/Last name, Title, Phone, Company, Message) with a modern card look and title/subtitle shortcode attributes.

= 1.4.1 =
* Upgrade button now opens the billing page on your account instead of the homepage.

= 1.4.0 =
* New: built-in contact form shortcode [digilucks_contact_form] with Cloudflare Turnstile spam protection, sends structured Name/Email/Phone/Message queries through the relay.

= 1.3.2 =
* Updated plan sizes on the dashboard (Starter 200, Pro 1,000 emails a month).

= 1.3.1 =
* Cleaner dashboard: other plugins' promotional notices are hidden on our screen.

= 1.3.0 =
* Added a "Send test email" button on the Settings page, and clearer relay error messages.

= 1.2.0 =
* Provider-managed mode: the API key can be supplied by your provider via a wp-config.php constant, so it is never shown or editable in the site admin. The key field is now masked by default.

= 1.1.0 =
* Redesigned dashboard: colorful animated stat cards, a monthly quota progress bar, status pills in the email log, and a Pro upgrade suggestion when you're on a smaller plan or running low.

= 1.0.0 =
* First release: wp_mail() relay, Reply-To control, usage dashboard, quota, optional fallback.
