<?php

namespace App\Mail;

use App\Mail\Concerns\TracksBounces;
use Illuminate\Mail\Mailable;

abstract class BounceTrackingMailable extends Mailable
{
    use TracksBounces;

    /**
     * Build the message with bounce tracking
     */
    public function build()
    {
        $message = $this->buildMessage();

        // Add bounce tracking headers
        $this->configureBounceTracking($message);

        return $message;
    }

    /**
     * Abstract method that child classes must implement instead of build()
     */
    abstract protected function buildMessage();
}