PHPackages                             obsidiane/notifuse-symfony-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. obsidiane/notifuse-symfony-bundle

ActiveSymfony-bundle[Mail &amp; Notifications](/categories/mail)

obsidiane/notifuse-symfony-bundle
=================================

Symfony bundle that integrates the Notifuse API and notification center

0.13.0(7mo ago)0199MITPHPPHP ^8.2CI passing

Since Nov 8Pushed 5mo agoCompare

[ Source](https://github.com/obsidiane-lab/notifuse-symfony-bundle)[ Packagist](https://packagist.org/packages/obsidiane/notifuse-symfony-bundle)[ RSS](/packages/obsidiane-notifuse-symfony-bundle/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (2)Versions (14)Used By (0)

Notifuse Symfony Bundle
=======================

[](#notifuse-symfony-bundle)

Symfony bundle to integrate the Notifuse API in your application. It focuses on:

- A small, explicit HTTP client wrapper for the Notifuse API (`Service\ApiClient`).
- A thin configuration layer (DI extension + YAML) to keep endpoints and options fully configurable. The Notification Center UI embed is handled directly by Notifuse’s front-end script and is not part of this bundle.

The bundle does not hide Symfony’s HttpClient. Instead, it applies the base URL, headers and common options for you, and gives you escape hatches to pass per‑request options when needed.

How It Works
------------

[](#how-it-works)

- Configuration is declared under the `notifuse` key and loaded by `DependencyInjection\NotifuseExtension`.
- Services are registered in `Resources/config/services.yaml` and autowired into your code.
- `Service\ApiClient` prefixes requests with `api_base_url`, injects authentication headers (`Authorization: Bearer …`, `X-Workspace-ID`) and merges configured HTTP client options. The UI widget is not generated by this bundle; integrate the Notification Center via Notifuse's front-end script.

Installation
------------

[](#installation)

Install from your application root:

```
composer require obsidiane/notifuse-symfony-bundle
```

If you are not using Symfony Flex auto‑registration, enable the bundle in the kernel:

```
return [
    // ...
    Obsidiane\Notifuse\NotifuseBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

Recommended configuration workflow:

```
###> obsidiane/notifuse-symfony-bundle ###
NOTIFUSE_API_BASE_URL="https://localapi.notifuse.com:4000"
NOTIFUSE_WORKSPACE_ID=""
NOTIFUSE_API_KEY=""
###< obsidiane/notifuse-symfony-bundle ###

```

```
notifuse:
  api_base_url: '%env(NOTIFUSE_API_BASE_URL)%'
  workspace_id: '%env(NOTIFUSE_WORKSPACE_ID)%'
  workspace_api_key: '%env(NOTIFUSE_API_KEY)%'
  http_client_options:
    timeout: 10.0
    max_redirects: 5
    verify_peer: true
    headers: { }
# The Notification Center embed is configured and loaded via Notifuse’s own front-end script.
```

Option reference:

- `api_base_url`: Base URL for the Notifuse API (e.g. `https://api.notifuse.com`).
- `workspace_id`: Your workspace identifier; sent as header and embed parameter.
- `workspace_api_key`: Bearer token used for API calls; keep it in env/secrets.
- `http_client_options`: Subset of Symfony HttpClient options applied to every call (`timeout`, `max_redirects`, `verify_peer`, `headers`). You can still override them per request. The Notification Center script and container are not managed by this bundle.

API Usage
---------

[](#api-usage)

Inject `Service\ApiClient` and call `request($method, $endpoint, $options = [])`. The `$endpoint` is appended to `api_base_url`.

```
use Obsidiane\Notifuse\ApiClient;

final class MyService
{
    public function __construct(private ApiClient $apiClient) {}

    public function ping(): array
    {
        // Performs GET https://…/api/workspace.status with auth headers
        return $this->apiClient->request('GET', '/api/workspace.status');
    }

    public function createSomething(array $payload): array
    {
        return $this->apiClient->request('POST', '/api/something', [
            'json' => $payload,
            // Optional per‑request overrides
            'headers' => [ 'X-Client-Name' => 'my-app' ],
            'timeout' => 8.0,
        ]);
    }
}
```

Error handling: network/HTTP client errors are wrapped in `Service\Exception\NotifuseClientException` with the original exception as previous. Catch it at your boundary if you want to map to domain errors.

```
try {
    $data = $this->apiClient->request('GET', '/api/workspace.status');
} catch (\Obsidiane\Notifuse\Exception\NotifuseClientException $e) {
    // Log and render a user‑friendly message
}
```

Endpoint Helpers
----------------

[](#endpoint-helpers)

The `ApiClient` exposes convenience methods for all Notifuse endpoints:

- `sendTransactional(array $notification, ?string $workspaceId = null, array $options = [])`: POST `/api/transactional.send`
- `upsertContact(array $contact, ?string $workspaceId = null, array $options = [])`: POST `/api/contacts.upsert`
- `getContactByEmail(string $email, ?string $workspaceId = null, array $options = [])`: GET `/api/contacts.getByEmail`
- `getContactByExternalId(string $externalId, ?string $workspaceId = null, array $options = [])`: GET `/api/contacts.getByExternalID`
- `importContacts(array $contacts, array $subscribeToLists = [], ?string $workspaceId = null, array $options = [])`: POST `/api/contacts.import`
- `deleteContact(string $email, ?string $workspaceId = null, array $options = [])`: POST `/api/contacts.delete`
- `updateContactListStatus(string $email, string $listId, string $status, ?string $workspaceId = null, array $options = [])`: POST `/api/contactLists.updateStatus`
- `publicSubscribeToLists(array $contact, array $listIds, ?string $workspaceId = null, array $options = [])`: POST `/subscribe` (no auth header sent)

Examples:

```
// 1) Send transactional notification
$client->sendTransactional([
    'id' => 'welcome_email',
    'contact' => ['email' => 'user@example.com'],
    'channels' => ['email'],
    'data' => ['user_name' => 'John'],
]);

// 2) Upsert a contact
$client->upsertContact([
    'email' => 'user@example.com',
    'first_name' => 'John',
]);

// 3) Get a contact
$client->getContactByEmail('user@example.com');
$client->getContactByExternalId('user_123');

// 4) Import contacts in batch
$client->importContacts([
    ['email' => 'user1@example.com'],
    ['email' => 'user2@example.com'],
], ['newsletter']);

// 5) Delete a contact
$client->deleteContact('user@example.com');

// 6) Update list subscription status
$client->updateContactListStatus('user@example.com', 'newsletter', 'active');

// 7) Public subscription (no Authorization header)
$client->publicSubscribeToLists([
    'email' => 'user@example.com',
], ['newsletter']);
```

Embedding the Notification Center
---------------------------------

[](#embedding-the-notification-center)

The UI embed is not handled by this bundle. Include Notifuse’s front-end script directly where you need the Notification Center.

HTTP Client Options
-------------------

[](#http-client-options)

Global defaults are provided via `notifuse.http_client_options`. You can still override on each call via `$options` in `ApiClient::request()`.

Common examples:

```
notifuse:
  http_client_options:
    timeout: 8.0
    verify_peer: true
    headers:
      X-Client-Name: 'my-app'
```

```
$this->apiClient->request('GET', '/api/endpoint', [
    'headers' => ['Accept-Language' => 'fr'],
    'timeout' => 5.0,
]);
```

Compatibility
-------------

[](#compatibility)

- PHP: `^8.0`
- Symfony: `^6.4` or `^7.0`

Services Summary
----------------

[](#services-summary)

Service IDClassDescription`Obsidiane\Notifuse\ApiClient``Service\ApiClient`Authenticated requests to the Notifuse API.CI, Releases and Composer Registry
----------------------------------

[](#ci-releases-and-composer-registry)

The pipeline validates the package on all branches. Releases are handled by GitHub Actions when pushing to `master` or when a tag is pushed.

See `.github/workflows/ci.yml` and `.github/workflows/release.yml` for the exact flow.

Testing
-------

[](#testing)

This bundle does not ship with its own test-suite. When writing tests in your application, you can mock `HttpClientInterface` and assert:

- URL resolution/headers in `ApiClient::request()`.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance67

Regular maintenance activity

Popularity14

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

13

Last Release

222d ago

PHP version history (2 changes)0.1.0PHP ^8.1

0.11.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/188919133?v=4)[obsidiane](/maintainers/obsidiane)[@Obsidiane](https://github.com/Obsidiane)

### Embed Badge

![Health badge](/badges/obsidiane-notifuse-symfony-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/obsidiane-notifuse-symfony-bundle/health.svg)](https://phpackages.com/packages/obsidiane-notifuse-symfony-bundle)
```

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

51390.8k2](/packages/web-auth-webauthn-framework)[web-auth/webauthn-symfony-bundle

FIDO2/Webauthn Security Bundle For Symfony

65474.5k9](/packages/web-auth-webauthn-symfony-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M518](/packages/shopware-core)[chameleon-system/chameleon-base

The Chameleon System core.

1027.9k4](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
