=== ai Inbox ===
Contributors: fragbait
Tags: gmail, google, oauth, email
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.14
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sign in with Google and list every Gmail label with its message count. Stripe and opening another person's mailbox are ai Inbox Pro features.

== Description ==

ai Inbox lets a WordPress site sign people in with Google and show each person's Gmail labels with a total message count.

You create the OAuth client in your own Google Cloud project and paste the client id and secret into the plugin settings. Tokens and the client secret are encrypted in the WordPress database with this site's salts.

This version does not delete, trash, or permanently delete mail. Moving mail, when a later version adds a screen for it, is limited to label changes. A low-level move method exists for that later screen. It is not available as a button, AJAX action, or REST route.

An optional button creates a Gmail label named "Delete Me". Creating that label does not move or delete any message.

Microsoft and Yahoo sign-in are not in this version.

== Installation ==

1. Upload the `aiinbox` folder to `/wp-content/plugins/`.
2. Activate ai Inbox.
3. Open ai Inbox → Settings and copy the redirect URI.
4. In the Google Cloud Console, select or create a project. The settings screen links to each page and lists the clicks.
5. Open Google Auth platform → Branding and set the app name. On Data Access, add the openid, email, profile, and `https://www.googleapis.com/auth/gmail.modify` scopes.
6. While the app is in Testing, open Google Auth platform → Audience and add the Google accounts that will sign in.
7. Open APIs & Services → Library and enable the Gmail API.
8. Open Google Auth platform → Clients, create a Web application client, and paste the redirect URI into Authorized redirect URIs.
9. Paste the client id and client secret into the settings screen.

Gmail modify is a restricted Google scope. While the Google app is in Testing, only the test users you list can connect.

== Frequently Asked Questions ==

= Does this plugin delete email? =

No. It lists labels and can create a label named Delete Me. It does not delete, trash, or permanently delete mail.

= Who can see a mailbox? =

Each user sees only the Google account connected to their own WordPress user. The mailbox screen does not accept a user id.

= Where are tokens stored? =

In user meta, encrypted with libsodium. The key comes from the WordPress auth salts. If those salts change, users need to connect Google again.

= Can visitors register with Google? =

Only if an administrator turns on "Create a WordPress user when a new verified Google account signs in". The new user receives the role selected on the settings screen. The default is Subscriber.

== Privacy ==

ai Inbox stores the Google client id, the encrypted client secret, and each connected user's encrypted tokens in this site's database. It sends those credentials only to Google's OAuth and Gmail endpoints. It does not contact any other service, and it does not load remote fonts, scripts, or images.

== Changelog ==

= 0.1.13 =
* Updates for this free plugin come from WordPress.org.

= 0.1.12 =
* Release 0.1.12

= 0.1.11 =
* Release 0.1.11

= 0.1.10 =
* The Plugins screen and the Dashboard menu say ai Inbox. The menu position is 100.

= 0.1.9 =
* Release 0.1.9

= 0.1.8 =
* Maintenance release: version bump.

= 0.1.7 =
* Package version 0.1.7.

= 0.1.6 =
* Package version 0.1.6.

= 0.1.5 =
* The installable package is published at https://ai.net.nz/aiplugin/aiinbox.zip.

= 0.1.4 =
* Check https://ai.net.nz/aiplugin/aiinbox.json for a newer version and install the zip published there.

= 0.1.3 =
* The name on the Plugins screen and in the Dashboard menu is ai Inbox.

= 0.1.2 =
* Creating folders no longer asks you to continue for each label. Each folder is listed when it is created, nested under its parent: Years, then the year, then the folder inside that year.

= 0.1.1 =
* The folder section is named Years. A folder named Archive is shown as Years, because Gmail will not create a label named Archive.

= 0.1.0 =
* Google sign-in and registration.
* Encrypted storage for the client secret and mailbox tokens.
* Gmail label inventory with message counts.
* Optional creation of a Delete Me label.
* Low-level label move method with no screen that calls it.
