Arsen Ibragimov
Arsen Ibragimov

Reputation: 435

How to set up headers "h:Reply-To" with Mailgun php API

How to set up headers "Reply-to" in Mailgun php API?

I've using this code but can't imaging hot to set up headers

Mail::send('email.message', $data, function ($message) use ($data) {
            $message->to($data['to_email'], $data['to_name'])
                ->subject($data['subject'])
                ->from($data['from_email'], $data['from_name']);
        });

Upvotes: 4

Views: 2281

Answers (1)

Fabio Antunes
Fabio Antunes

Reputation: 22862

It's as simple as adding a replyTo on your $message chain

Mail::send('email.message', $data, function($message) use($data)
{
    $message->to($data['to_email'], $data['to_name'])
        ->subject($data['subject'])
        ->from($data['from_email'], $data['from_name'])
        ->replyTo('[email protected]');
});

if you want to add a name to the reply to, just add another parameter with the name:

->replyTo('[email protected]', 'Arsen Ibragimov')

Upvotes: 3

Related Questions