0
votes

When the user of my website used the contact form, i want send a mail with the confirmation to the user and send to me other message with the created ticket.

I´m using Laravel 5.2 + Mailgun

But only sent the last mail to my email hello@frikinow.com, the user confirmation email is not sent.

Laravel not returns any error. This is my code:

// for the client mail
                Mail::send('emails.success_email', ['name' => Input::get('nombre'), 'content' => $content], function ($message)
                {
                    $message->subject('FrikiNow ha recibido su consulta');

                    $message->from('hello@frikinow.com', 'FrikiNow Support');

                    $message->to(Input::get('email'));

                });

                // for me
                Mail::send('emails.ticket_email', ['email'=> Input::get('email'),'name' => Input::get('nombre'), 'content' => Input::get('mensaje'),'mobile_phone' =>Input::get('telefono')], function ($message)
                {
                    $message->subject('Ticket de Cliente: '.Input::get('asunto'));

                    $message->from('hello@frikinow.com', Input::get('nombre'));

                    $message->to('hello@frikinow.com');

                });

How I can send two different emails at once?

1

1 Answers

0
votes

You may add CC header

Im not full aware of MailGun API, but you can try this:

$message->cc('email@example.com'); //Copy of the message goes to this email