=== SK Lettermint Bounce Sync ===
Contributors: svenkersten
Tags: lettermint, fluentcrm, bounce, webhook, newsletter
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sends bounces, spam complaints and unsubscribes from Lettermint to FluentCRM through a signed webhook.

== Description ==

When you send email through Lettermint, Lettermint stops delivering to addresses that bounced or complained. Your newsletter plugin does not hear about it, so those contacts stay subscribed. This plugin closes that gap.

* Receives Lettermint webhooks on its own REST endpoint and verifies the HMAC-SHA256 signature before reading anything.
* Hard bounce sets the FluentCRM contact to Bounced, a spam complaint to Complained, an unsubscribe to Unsubscribed. Soft bounces are counted by FluentCRM itself and become Bounced after its limit.
* Only existing contacts are updated. Recipients of order emails are never added to your CRM.
* A status never becomes lighter: a later unsubscribe does not overwrite a spam complaint.
* Duplicate deliveries (Lettermint retries for up to 14 hours) are recognised by event ID.
* The settings screen shows the webhook URL and the last 20 events, with masked addresses.

Internal draft. The readme for WordPress.org follows later.

== Installation ==

1. Upload the plugin and activate it.
2. Go to Sven Kersten > Lettermint and copy the webhook URL.
3. In Lettermint, create a webhook for the project with the events message.hard_bounced, message.soft_bounced, message.spam_complaint and message.unsubscribed.
4. Copy the webhook secret (starts with whsec_) into the plugin settings, or define SK_LETTERMINT_WEBHOOK_SECRET in wp-config.php.
5. Send a test webhook from Lettermint. It appears in the event list.

== Changelog ==

= 0.1.1 =
* Security: updates are only installed when they carry a valid signature from the publisher. A tampered or unsigned update is refused and nothing is installed.

= 0.1.0 =
* First version: signed webhook, FluentCRM integration, settings screen with event log.
