Skip to content

Cross-Module Integration Recipes

Each trk/ module exposes clean ProcessWire hooks and typed PHP services so you can compose multi-module workflows in site/ready.php without modifying any module source files.

Section titled “Recipe 1: Form Inquiry -> Charter Option -> Hosted Payment Link -> Confirmation Email”

This recipe connects Forms, Charter, Contacts, Currency, Payments, and WireMailPHPMailer for Aegean Voyages (aegeanvoyages.example):

<?php
declare(strict_types=1);
namespace ProcessWire;
use Totoglu\Currency\Money;
/**
* Convert a qualified Charter inquiry into an option booking,
* generate a 50% EUR deposit payment link, and email the guest.
*/
$charter = Charter::requireInstance($wire);
$payments = Payments::requireInstance($wire);
$inquiry = $wire->entries->get($inquiryId);
if ($inquiry === null || $inquiry->isNull()) {
return;
}
// 1. Lock yacht availability and create a 48-hour Option booking
$booking = $charter->workflow()->convertInquiryToBooking($inquiry);
// 2. Generate a branded 7-day HMAC proposal URL (/_charter/proposal/{token})
$proposalUrl = $charter->proposals()->shareUrl('booking', (string) $booking->id, branded: true);
// 3. Issue a hosted 50% deposit payment link via Payments
$depositMinor = (int) round(((float) $booking->get('grand_total')) * 0.50 * 100);
$link = $payments->links()->create([
'title' => 'Charter Deposit: ' . (string) $booking->get('booking_code'),
'amount' => $depositMinor,
'currency' => (string) $booking->get('currency') ?: 'EUR',
'reference' => (string) $booking->get('booking_code'),
]);
// 4. Send confirmation via WireMailPHPMailer
$wire->mail->new()
->to((string) $inquiry->get('client_email'), (string) $inquiry->get('client_name'))
->subject('Option Confirmed: ' . (string) $booking->get('booking_code'))
->body("Review your proposal: {$proposalUrl}\nPay 50% deposit: {$link->url}")
->send();
  • A new charter-bookings entry in Option status with hold_until set 48 hours ahead (monitored automatically by ExpireCharterHoldsTask).
  • A branded, private-field-redacted proposal at /_charter/proposal/{token}.
  • A hosted Payments checkout link backed by your active Stripe, Paddle, PayPal, or iyzico driver.
  • A DKIM-signed transactional confirmation email delivered through WireMailPHPMailer.

Recipe 2: Multi-Language Localization & SEO Grounding With Ai + Seo

Section titled “Recipe 2: Multi-Language Localization & SEO Grounding With Ai + Seo”

Automatically localize a newly published yacht listing into Turkish with protected maritime terminology and verify SEO metadata in one CLI pipeline:

Terminal window
# 1. Localize page 1042 into Turkish while keeping APA, Gulet, and Gocek consistent
php vendor/bin/wire ai:translate 1042 --to=tr --glossary=maritime-terms --json
# 2. Run a deterministic + AI pre-publish audit (fails CI if issues > 0)
php vendor/bin/wire ai:audit --template=yacht --locale=tr --fail-on-issues --max-issues=0 --json
{
"ok": true,
"audited": 12,
"issues": 0,
"locale": "tr",
"glossary": "maritime-terms"
}

Next steps