=== CHAMPREP Mail ===
Contributors: aatemnkeng
Tags: email, woocommerce, transactional email, order emails, inbox
Requires at least: 6.7
Requires PHP: 8.0
Stable tag: 0.4.0
Tested up to: 7.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Read and send CHAMPREP Mail in WordPress, and send WooCommerce store emails from your own verified domain.

== Description ==

CHAMPREP Mail is the official CHAMPREP LLC plugin for accessing CHAMPREP Mail from a WordPress dashboard. Connect a CHAMPREP account to view authorized mailboxes, read conversations, send messages with attachments, manage sending domains, and request DNS verification.

**WooCommerce store emails (optional).** With WooCommerce active, you can send the store's emails (order confirmations, processing and completed orders, refunds, customer notes, new-account and password-reset emails, and the store's own new-order alerts) from a mailbox on your verified CHAMPREP Mail domain. You choose the sender mailbox and exactly which emails go through CHAMPREP; nothing changes until you turn it on. Every email sent this way is saved in that mailbox's Sent folder, customer replies arrive in the same mailbox, and the order gets a note. If CHAMPREP cannot accept an email (for example the domain is not verified, the plan limit is reached, or the service cannot be reached), WordPress sends it with its usual mailer instead, so customers always receive it.

**Order and customer context.** On the WooCommerce order screen, a CHAMPREP Mail panel lists the store emails sent for that order and lets you email the customer from your store mailbox; the message is noted on the order. When you read a conversation in the plugin's inbox, the sender's WooCommerce orders (number, status, total, date) are shown next to it.

The plugin works without WooCommerce: the inbox, domain and message features do not need it. It does not change WordPress's own system emails (only WooCommerce's emails, when you turn that on), and it does not send marketing or bulk email.

== Installation ==
1. Install and activate the CHAMPREP Mail plugin.
2. Go to Settings > CHAMPREP Mail and connect the CHAMPREP account that owns the Mail subscription.
3. Add and verify the sending domain in CHAMPREP Mail.
4. Browse mailboxes, read conversations, and compose messages from Settings > CHAMPREP Mail. Use the full CHAMPREP Mail service for features not available in this embedded client.
5. WooCommerce stores: under Settings > CHAMPREP Mail > WooCommerce store emails, choose the sender mailbox and the emails to send, then turn sending on.

== Screenshots ==

1. Read and answer mail in WordPress; the sender's WooCommerce orders appear next to the conversation.
2. The CHAMPREP Mail panel on a WooCommerce order: the order's emails and a form to email the customer.
3. Choose the sender mailbox and which WooCommerce emails go out through CHAMPREP Mail.

== Frequently Asked Questions ==

= Do I need a CHAMPREP account? =

Yes. The plugin connects to the CHAMPREP account that holds your CHAMPREP Mail plan. CHAMPREP enforces its plan, sending limits and domain verification.

= Which WooCommerce emails can go through CHAMPREP Mail? =

Any email WooCommerce sends through its mailer: new, processing, completed, refunded and failed orders, customer notes, invoices, new-account and password-reset emails, and emails added by other WooCommerce extensions that use the WooCommerce mailer. You pick them one by one under Settings > CHAMPREP Mail > WooCommerce store emails.

= What happens if CHAMPREP cannot send an email? =

WordPress sends it with its usual mailer straight away, the order gets a note saying so, and administrators see a warning. Customers always receive their email.

= Where do customer replies go? =

To the sender mailbox you chose. Read and answer them in Settings > CHAMPREP Mail, where the customer's WooCommerce orders are shown next to the conversation, or in CHAMPREP Mail on the web and mobile apps.

= Why do I need to reconnect every month? =

For security, CHAMPREP approves a connected site for 30 days at a time. Five days before that ends, WordPress shows a "Reconnect" button on every admin page; one click and a CHAMPREP sign-in renews it, and your settings stay as they are. If the approval ends anyway, WooCommerce emails keep going out through WordPress's usual mailer until you reconnect.

= Does it change WordPress's own emails? =

No. Only WooCommerce's emails are affected, and only the ones you select.

= Does it work with High-Performance Order Storage? =

Yes. The plugin declares compatibility with High-Performance Order Storage and the Cart and Checkout blocks, and stores its order data through WooCommerce's order APIs.

== External services ==

This plugin connects to CHAMPREP LLC's CHAMPREP Auth and Mail services. CHAMPREP Auth registers the OAuth client, signs the site administrator into CHAMPREP, and issues or refreshes the delegated authorization. CHAMPREP Mail provides the mailbox, message, sending-domain, DNS-verification, and test-delivery functions. These services are required for the plugin to work.

When an administrator connects the plugin, WordPress sends the integration name, site callback URL, redirect URL, and plugin software/version metadata to CHAMPREP Auth to register the OAuth client. During sign-in, the authorization code and PKCE proof are exchanged for delegated tokens. The plugin stores the client ID and encrypted access and refresh tokens in the site's WordPress options; message bodies and attachments are not stored as WordPress options by this plugin.

When an administrator views or uses a Mail feature, the plugin sends the delegated access token and the requested mailbox, folder, conversation, domain, or message data to the CHAMPREP Mail API. Reading a conversation transfers its message content to the WordPress server for display. Sending a message transfers the selected sender, recipient, subject, body, and any selected attachments to the Mail API. Domain actions transfer the domain name or domain identifier. Apart from WooCommerce store emails and connection upkeep, requests occur only in response to an administrator opening or using the corresponding feature.

When WooCommerce store emails are turned on, each selected WooCommerce email is sent to the CHAMPREP Mail API at the moment WooCommerce sends it (for example when a customer places an order). The request carries the sender mailbox, the recipient addresses, the subject, the email content (which includes order details and the customer's name, billing and shipping addresses as WooCommerce writes them) and any attachments WooCommerce adds. CHAMPREP Mail delivers the email and keeps a copy in the store's mailbox. While connected, the plugin also renews its CHAMPREP authorization about once an hour with CHAMPREP Auth (no store data is sent), so store emails keep working when no administrator is signed in. The plugin adds suggested text for this to the site's privacy policy guide.

The plugin does not add analytics or advertising tracking.

CHAMPREP's [Terms of Service](https://champrep.com/terms) and [Privacy Policy](https://champrep.com/privacy-policy) describe the service and its handling of information.

== Security and data ==

OAuth authorization uses state and PKCE S256. Tokens are encrypted in WordPress options with AES-256-GCM using WordPress auth salts. The Mail API remains authoritative for account access, domain verification, service entitlements, quotas, and sending policy.

Reconnect once a month: CHAMPREP asks for a fresh approval 30 days after you connect. Five days before, administrators see a one-click Reconnect button. Until you reconnect, WooCommerce emails are sent by WordPress's usual mailer.

For a full disconnect, revoke the CHAMPREP Mail connection under your CHAMPREP account's connected-app security settings, then disconnect the local plugin. The plugin does not have permission to revoke its own OAuth grant.

== Limitations ==
The embedded client currently provides mailbox and folder selection, thread list and reading, text composition, attachments on outgoing messages, domain status, DNS verification requests, and test delivery. Advanced search, routing of WordPress core system emails, campaigns, and shared-mailbox ticket automation are not enabled by this package. Full Mail remains available at https://mail.champrep.com.

== Changelog ==

= 0.4.0 =
* New: send WooCommerce store emails from your CHAMPREP Mail mailbox, with automatic fallback to WordPress's mailer, order notes and a recent-activity log.
* New: CHAMPREP Mail panel on WooCommerce orders to see the order's emails and email the customer.
* New: the customer's WooCommerce orders are shown next to their conversations in the inbox.
* Keeps the CHAMPREP connection active for unattended store emails, and warns before the approval needs renewing.
* Declares compatibility with WooCommerce High-Performance Order Storage and the Cart and Checkout blocks.

= 0.3.1 =
* First WordPress.org release: inbox, compose with attachments, sending domains and DNS verification.
