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

Laravel Mailcoach Sendinblue Feedback Laravel Package

spatie/laravel-mailcoach-sendinblue-feedback

Addon for spatie/laravel-mailcoach that processes Sendinblue campaign feedback (bounces, complaints, etc.) so Mailcoach can automatically handle delivery events and keep subscriber status and stats in sync.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require spatie/laravel-mailcoach-sendinblue-feedback
    

    Publish the config file:

    php artisan vendor:publish --provider="Spatie\MailcoachSendinblueFeedback\MailcoachSendinblueFeedbackServiceProvider"
    
  2. Configuration Ensure your .env has Sendinblue API credentials:

    SENDINBLUE_API_KEY=your_api_key_here
    MAILCOACH_SENDINBLUE_FEEDBACK_ENABLED=true
    
  3. First Use Case After sending a campaign via Mailcoach, the package automatically processes feedback (bounces, spam reports, unsubscribe events) from Sendinblue. No manual intervention is required—just ensure your Mailcoach campaigns are configured to use Sendinblue as the mail provider.


Implementation Patterns

Workflow Integration

  1. Automatic Feedback Processing The package hooks into Mailcoach’s campaign lifecycle. When a campaign is sent via Sendinblue, the package:

    • Polls Sendinblue’s API for feedback events (e.g., hard bounces, spam complaints).
    • Updates Mailcoach’s campaign statistics and recipient statuses accordingly.
    • Logs events for auditing (via Laravel’s logging system).
  2. Manual Triggering (Advanced Use) If needed, manually trigger feedback processing for a specific campaign:

    use Spatie\MailcoachSendinblueFeedback\Facades\SendinblueFeedback;
    
    SendinblueFeedback::processFeedbackForCampaign($campaignId);
    
  3. Event Listeners Extend functionality by listening to feedback events. Example:

    // In EventServiceProvider
    protected $listen = [
        'Spatie\MailcoachSendinblueFeedback\Events\FeedbackProcessed' => [
            'App\Listeners\LogFeedbackToDatabase',
        ],
    ];
    
  4. Custom Feedback Handling Override default behavior by binding your own handler:

    // In a service provider
    $this->app->bind(
        Spatie\MailcoachSendinblueFeedback\FeedbackHandlers\FeedbackHandler::class,
        App\Handlers\CustomSendinblueFeedbackHandler::class
    );
    

Gotchas and Tips

Pitfalls

  1. API Rate Limits Sendinblue’s API has rate limits. If processing large campaigns, implement retries with exponential backoff:

    // config/mailcoach-sendinblue-feedback.php
    'max_retries' => 3,
    'retry_delay_seconds' => 10,
    
  2. Timezone Mismatches Ensure Sendinblue’s timestamps align with your Laravel app’s timezone (configured in config/app.php). Feedback events may appear misaligned otherwise.

  3. Webhook vs. Polling The package uses polling (not webhooks) by default. For real-time processing, consider:

    • Using Sendinblue’s webhooks alongside this package.
    • Implementing a queue worker to process feedback asynchronously.
  4. Recipient Matching Feedback events rely on email addresses to match recipients. Ensure:

    • No duplicate emails in your Mailcoach lists.
    • Email addresses are normalized (e.g., user@example.com vs. User@example.com).

Debugging

  • Enable Debug Logging Add to .env:

    MAILCOACH_SENDINBLUE_FEEDBACK_LOG_LEVEL=debug
    

    Check logs at storage/logs/laravel.log.

  • Verify API Credentials Test connectivity with:

    php artisan mailcoach:sendinblue-feedback:test-connection
    
  • Check Feedback Events Inspect processed events in the database table:

    SELECT * FROM mailcoach_feedback_events;
    

Extension Points

  1. Custom Feedback Types Extend the FeedbackHandler to process additional Sendinblue event types (e.g., soft bounces):

    namespace App\Handlers;
    
    use Spatie\MailcoachSendinblueFeedback\FeedbackHandlers\FeedbackHandler;
    
    class CustomSendinblueFeedbackHandler extends FeedbackHandler
    {
        protected function handleSoftBounce($event)
        {
            // Custom logic
        }
    }
    
  2. Database Schema Modify the mailcoach_feedback_events table by publishing and extending the migration:

    php artisan vendor:publish --tag="mailcoach-sendinblue-feedback-migrations"
    
  3. Testing Use the package’s test helpers to mock Sendinblue responses:

    use Spatie\MailcoachSendinblueFeedback\Testing\MocksSendinblueFeedback;
    
    public function testFeedbackProcessing()
    {
        $this->mockSendinblueFeedback();
        // Assertions...
    }
    
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport