| 1 |
<?php |
| 2 |
/** |
| 3 |
* A follow-up adapter that applies to every form, not to one integration. |
| 4 |
* |
| 5 |
* @package Forge12\DoubleOptIn\FollowUp |
| 6 |
* @since 5.8.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
declare( strict_types=1 ); |
| 10 |
|
| 11 |
namespace Forge12\DoubleOptIn\FollowUp; |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; |
| 15 |
} |
| 16 |
|
| 17 |
/** |
| 18 |
* Additive contract (Core API 4.6). A form adapter owns the follow-up of |
| 19 |
* one integration (cf7, elementor …); a global adapter adds its own |
| 20 |
* actions to every opt-in that has a form adapter — webhooks, newsletter |
| 21 |
* sync. It gets the same guarantees: planned once, claimed atomically, |
| 22 |
* retried with backoff, shown in the follow-up panel. |
| 23 |
* |
| 24 |
* Rules on top of FollowUpAdapterInterface: |
| 25 |
* - `getIntegration()` names the adapter (e.g. `webhooks`); it is stored |
| 26 |
* on every row it plans and never matches a form type. |
| 27 |
* - Every action id starts with `<integration>:`. Actions that do not |
| 28 |
* are dropped when planning, so no adapter can take over another's id. |
| 29 |
* - `execute()` and `onSettled()` see only the adapter's own rows. |
| 30 |
* |
| 31 |
* An opt-in from an integration without a form adapter is not followed up |
| 32 |
* by global adapters either: its confirmation still runs the old path. |
| 33 |
*/ |
| 34 |
interface GlobalFollowUpAdapterInterface extends FollowUpAdapterInterface { |
| 35 |
} |
| 36 |
|