0

How can I send email and SMS together using Laravel 5.5 ?

Should I use mailable and SMS service or Notification with SMS and How ?

Sarita Sharma
  • 253
  • 2
  • 8
  • 19

2 Answers2

0

You can create an event in laravel's App/Events folder. put all the code for send mail and sms with there configuration, just call that event wherever you want to hit sms or mail.

Harish
  • 51
  • 13
0

You may create one function which will include both notify() method for an email and dispatch() method for message
example

   public function Notification(Model $tender)
{
    $user = access()->user();
    /* Send confirmation email */
        $tender->notify(new Email($user));

    /* Send confirmation message */

    Send::dispatch($user);
}

Then you will just call a single function that is Notification() which will do both sending email and message

Francis Tito
  • 126
  • 1
  • 9