Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Mailjet Apiv3 Php

Mailjet Apiv3 Php Laravel Package

mailjet/mailjet-apiv3-php

Official Mailjet PHP wrapper for the Mailjet API v3. Send and track transactional emails, manage contacts, lists and templates, handle events, and integrate Mailjet features in PHP apps with simple client setup and HTTP calls.

View on GitHub
Deep Wiki
Context7

[API v3] Mailjet PHP Wrapper

Frequently asked questions about Mailjet Apiv3 Php
How do I integrate this Mailjet PHP wrapper with Laravel?
Bind Mailjet credentials in `config/services.php` and register the client in Laravel’s service container. Use dependency injection to instantiate the client in controllers or services. The wrapper’s PSR-18 compliance ensures compatibility with Laravel’s built-in HTTP clients like Guzzle or Symfony HttpClient.
Does this package support Laravel’s queue system for async email sending?
The wrapper itself is synchronous, but you can wrap Mailjet calls in a Laravel job and dispatch them to a queue. Use Laravel’s queue workers to process emails asynchronously, ensuring non-blocking email delivery.
What Laravel versions are compatible with this package?
This package requires PHP 8.1+, which aligns with Laravel 9+. If you’re using an older Laravel version, you’ll need to upgrade or use a different Mailjet package that supports PHP 7.x.
How do I handle API errors or rate limits in Laravel?
The wrapper returns a `Response` object, but for Laravel-specific error handling, create custom exceptions (e.g., `MailjetException`) and log them using Laravel’s logging system. For rate limits, implement retry logic with Laravel’s retry helper or a custom decorator.
Can I use this wrapper with a custom HTTP client like Symfony HttpClient?
Yes, the wrapper supports ‘Bring Your Own Client’ (PSR-18 compliant). Explicitly require `symfony/http-client` in your `composer.json` and configure the wrapper to use it instead of the auto-installed Guzzle.
How do I mock the Mailjet client for testing in Laravel?
Use the wrapper’s `disable API call` feature by setting `$CALL = false` in the client configuration. This allows you to test your Laravel logic without hitting Mailjet’s API, simplifying unit and integration tests.
Is there a Laravel-specific package for Mailjet, or should I use this wrapper?
If Mailjet offers an official Laravel package, prefer it for tighter integration. This wrapper is ideal if you need full control over the Mailjet API or require features like SMS support (v4) not covered by Laravel-specific packages.
How do I manage API credentials securely in Laravel?
Store credentials in Laravel’s `.env` file (e.g., `MAILJET_API_KEY`, `MAILJET_API_SECRET`) and reference them in `config/services.php`. For production, consider using a secrets manager like AWS Secrets Manager or Laravel Forge for enhanced security.
Does this wrapper support batching or parallel requests for high-volume emails?
The wrapper supports batching via its resource methods, but parallel requests require custom logic. Use Laravel’s queue system or a library like `spatie/async` to process emails concurrently while respecting Mailjet’s rate limits.
What’s the best way to log Mailjet API responses or errors in Laravel?
Extend the wrapper’s `Response` object to log data using Laravel’s logging system (e.g., `Log::debug()`). For centralized monitoring, integrate with tools like Sentry or Laravel’s built-in error logging to track API failures and performance.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi