Download the PHP package w4msolutions/w4m-email-gateway without Composer
On this page you can find all versions of the php package w4msolutions/w4m-email-gateway. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download w4msolutions/w4m-email-gateway
More information about w4msolutions/w4m-email-gateway
Files in w4msolutions/w4m-email-gateway
Download w4msolutions/w4m-email-gateway
More information about w4msolutions/w4m-email-gateway
Files in w4msolutions/w4m-email-gateway
Vendor w4msolutions
Package w4m-email-gateway
Short Description Yii2 mailer adapter that sends emails through the W4M Email Gateway service.
License proprietary
Package w4m-email-gateway
Short Description Yii2 mailer adapter that sends emails through the W4M Email Gateway service.
License proprietary
Please rate this library. Is it a good library?
Informations about the package w4m-email-gateway
W4M Email Gateway Mailer
Yii2 mailer adapter for sending emails through the W4M Email Gateway API.
Package
- Name:
w4msolutions/w4m-email-gateway - Type:
yii2-extension - Namespace:
W4MSolutions\W4mEmailGateway
Features
- Drop-in compatible mailer component for current Yii2 mail usage.
- Keeps Yii compose/render/layout flow by extending
yii\symfonymailer\Mailer. - Supports existing
yii\symfonymailer\Messagecalls used across the app. - Sends payload to gateway
/sendendpoint with API key authentication. - Converts regular attachments to gateway
attachments[]payload. - Rewrites inline CID embeds (for example
cid:image.jpg) intodata:URIs. - Retries failed sends with incremental cooldown (default: 3 attempts, waits 1s then 3s).
Class and Function Reference
W4MSolutions\W4mEmailGateway\Mailer
Main Yii mailer component.
init()initializes default collaborators (GatewayPayloadBuilder,GatewayClient).sendMessage($message)validates config, maps payload, and executes retry-aware delivery.sendWithRetry(array $payload)runs delivery attempts with incremental cooldown.sendPayload(array $payload)performs one HTTP call throughGatewayClient.waitBeforeRetry(int $seconds)sleeps between retries (override-friendly for tests).
W4MSolutions\W4mEmailGateway\GatewayPayloadBuilder
Converts yii\symfonymailer\Message into gateway JSON payload.
build(Message $message)maps recipients, subject/body, from/from_name, reply_to, attachments.normalizeAddressList(...)andextractPrimaryAddressAndName(...)standardize address data.buildAttachmentPayload(...)base64-encodes attachment data for gateway transport.
W4MSolutions\W4mEmailGateway\CidEmbedRewriter
Makes inline embedded images compatible with gateway body-only HTML transport.
rewrite(string $html, array $attachments)replacescid:references withdata:URIs.
W4MSolutions\W4mEmailGateway\GatewayClient
HTTP transport client.
postJson(...)sends request using cURL (preferred) or stream fallback.
Configuration
This is the full configuration array for the mailer component with all options:
Retry Behavior
Default retry flow is:
- Attempt 1 immediately.
- If it fails, wait 1 second.
- Attempt 2.
- If it fails, wait 3 seconds (1 + 2).
- Attempt 3.
You can tune this with:
maxRetriesretryInitialDelaySecondsretryDelayIncrementSeconds
Running Tests (Docker)
Run tests in a dedicated container from this package folder.
Required Tools
- Docker Engine
- Docker Compose v2 (
docker compose)
All commands below are executed from the package root.
Run All Package Tests
Run One Test File (Optional)
Run One Test Method (Optional)
Build or Rebuild the Test Image (Optional)
Open a Shell in the Test Container (Optional)
Notes About the Standalone Setup
docker-compose.ymlandDockerfilelive inside this package and do not depend on the parent project.docker/run-tests.shinstalls Composer dependencies automatically whenvendor/autoload.phpis missing.- A Docker named volume (
composer-cache) is used to speed up repeated Composer installs.
Notes
- The gateway schema documents
to,cc,bcc,subject,body,attachments,from_name, andreply_to. - This adapter also forwards a
fromfield when available. - If
useFileTransportis true, Yii saves.emlfiles and skips gateway delivery.
All versions of w4m-email-gateway with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1.0
yiisoft/yii2 Version >=2.0.45
yiisoft/yii2-symfonymailer Version >=2.0.3
yiisoft/yii2 Version >=2.0.45
yiisoft/yii2-symfonymailer Version >=2.0.3
The package w4msolutions/w4m-email-gateway contains the following files
Loading the files please wait ...