laravel-sparkpost-driver icon indicating copy to clipboard operation
laravel-sparkpost-driver copied to clipboard

Add metadata to mailable

Open basvandertogt opened this issue 2 years ago • 0 comments

I'm trying to add metadata to my mailable but this does not work with Laravel 9.

public function headers()
    {
        $options = [
            'metadata' => [
                'team_id' => (string)$this->message->team_id,
                'user_id' => (string)$this->message->user_id,
                'message_id' => (string)$this->message->id
            ]
        ];

        return new Headers(text: [
            'X-MSYS-API' => json_encode($options)
        ]);
    }

Any idea how to fix this?

basvandertogt avatar Nov 21 '22 17:11 basvandertogt