Scheduling delivery time in Mailgun using Laravel

453 views Asked by At

I am trying to figure out how to use Mailgun's email scheduling delivery feature, but I can't figure out how to integrate this with Laravel 5.1 using the Mail facade. I'm not sure if this is possible using the facade or if I have to use mailgun's php library instead.

I am trying to make it so that users can specify when they want emails sent from my blog so that they can get it sent to them when it is most convenient for them (and hopefully make them more likely to read the blog).

1

There are 1 answers

0
Jennifer Miranda Beuses On BEST ANSWER

I do something similar. I'm using laravel 5.2 and what I do is call from my kernel to my controllers this way:

For this it is important that you have properly configured your connection to the database on your .env and you have updated all with "composer update" (this I add it because it was what I did to make me work properly, so I suggest from experience my experienced personnel only)

kernel.php:

$schedule
    ->call('App\Http\Controllers\MyController@MyAction')
    ->everyMinute();

MyController.php

public function MyAction(Request $request){
  # Logic code
}

I hope you serve to start.