Docker Compose environments for dev/staging/production (MariaDB, Redis, Caddy, Action Scheduler cron sidecar), an idempotent deploy script, git-hook-based deploy pipeline, backup/restore scripts, and the bookstore-core plugin stub with WooCommerce HPOS compatibility declared. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
23 lines
668 B
PHP
23 lines
668 B
PHP
<?php
|
|
/**
|
|
* Route outgoing mail to a local catcher outside production, so no test
|
|
* email ever reaches a real customer (design doc §01/§08).
|
|
*
|
|
* Same code in every environment — the only thing that changes is the
|
|
* WP_ENVIRONMENT_TYPE define set per-environment in docker-compose.
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
if (wp_get_environment_type() === 'production') {
|
|
return;
|
|
}
|
|
|
|
add_action('phpmailer_init', function ($phpmailer) {
|
|
$phpmailer->isSMTP();
|
|
$phpmailer->Host = getenv('MAIL_CATCHER_HOST') ?: 'mailhog';
|
|
$phpmailer->Port = getenv('MAIL_CATCHER_PORT') ?: 1025;
|
|
$phpmailer->SMTPAuth = false;
|
|
$phpmailer->SMTPAutoTLS = false;
|
|
});
|