targito/targito-api-bundle
Targito API bundle for PHP/Symfony apps: a lightweight client wrapper that lets you connect to the Targito marketing automation platform, manage contacts and mailing lists, and trigger transactional emails and campaigns directly from your code through a simple, framework-integrated service.
TargitoApiBundle class, DependencyInjection/Configuration.php, and Resources/config/services.xml are dead weight — Composer will install them, but nothing auto-registers. You will almost certainly consume the underlying targito/targito-api-php client directly and write a ~20-line service provider around it.DependencyInjection/Configuration.php before installing. It is the only source of truth for config keys (API key, account/workspace identifier, base URL/sandbox flag). The README is thin and the repo is effectively unmaintained (last release 2021-05-07, 0 stars, 0 dependents), so treat the code as the documentation.composer require targito/targito-api-bundle
ls vendor/targito/targito-api-bundle/src
ls vendor/targito/targito-api-php/src # the actual client you'll use
config/bundles.php, then configure in config/packages/targito_api.yaml with env vars:
targito_api:
api_key: '%env(TARGITO_API_KEY)%'
# account/workspace/base_uri per Configuration.php
// config/services.php
'targito' => [
'api_key' => env('TARGITO_API_KEY'),
'account' => env('TARGITO_ACCOUNT_ID'),
],
// app/Providers/TargitoServiceProvider.php
$this->app->singleton(\Targito\Api\TargitoClient::class, fn ($app) =>
new \Targito\Api\TargitoClient(config('services.targito.api_key'))
);
(Adjust the constructor signature to whatever vendor/targito/targito-api-php/src exposes — it is likely a Guzzle-based client taking an API key and optional GuzzleHttp\ClientInterface.)App\Services\Targito\TargitoGateway with intent-revealing methods (subscribe(string $email, array $attributes), unsubscribe(), sendTransactional()). When you eventually fork or replace the SDK (plan for it), you change one file.ShouldQueue listener or a dedicated SyncContactToTargito job with $tries = 3, backoff() of 10/60/300s, and a failed() that logs and alerts. In Symfony, the Messenger equivalent.Registered, ProfileUpdated, OrderPlaced → listener → job → gateway. Keep the mapping (Laravel model → Targito attributes) in a small mapper class so field renames are one-line changes.targito:backfill-contacts command that chunks User::query()->chunkById(500, ...), dispatches jobs, and is safe to re-run (idempotent upserts by email). Never loop N users inside one job — you'll hit timeouts and lose the whole batch on one bad record.app(TargitoClient::class) bound per env) rather than hardcoding list IDs. Keep list/campaign IDs in config/targito.php, not scattered as magic strings.$this->app->instance(TargitoGateway::class, new FakeTargito)), and assert Bus::assertDispatched(SyncContactToTargito::class) after registration. For unit tests of the gateway itself, inject a mocked GuzzleHttp\ClientInterface / PSR-18 client and assert on the request URI and JSON body — do not hit the real API in CI.use.debug, and request body at debug only with the API key redacted. This is your only real observability with an unmaintained vendor.composer.json (no ^), commit composer.lock, and assume no upstream bug fixes. Budget for forking targito/targito-api-php into a VCS repository the day the API changes or a dependency conflicts.guzzlehttp/guzzle or symfony/http-client. If composer require fails, don't --ignore-platform-reqs your way through it — fork the SDK, loosen the constraint, and test.php artisan vendor:publish, it doesn't exist. Expect to hand-write all wiring.%env()% inside certain bundle config nodes is resolved at container compile time; after changing .env in a cached deployment you must bin/console cache:clear. In Laravel, php artisan config:cache will bake the key in — re-run it after rotating TARGITO_API_KEY..env / a secrets manager, never in config/targito.php defaults, and add key redaction to your logging middleware before you ship.$tries/backoff) rather than trusting the SDK — retrying inside a request thread will hang your app.try/catch for the SDK's exception type and a broad Throwable, and decide explicitly per call whether failures are fatal (transactional send) or best-effort (marketing list sync — swallow and log).php artisan queue:work)? (2) is the API key the sandbox one — sandbox writes don't appear in production lists; (3) log the raw response body — some marketing APIs return HTTP 200 with an error payload; (4) check whether the SDK swallows non-2xx into a boolean.targito/targito-api-* with a hand-rolled Guzzle client should be an afternoon, not a rewrite.How can I help you explore Laravel packages today?