SHARE
TWEET

Untitled

a guest Jun 26th, 2019 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. C:xampphtdocsdtcburger.com>php artisan schedule:run
  2. Running scheduled command: "C:xamppphpphp.exe" "artisan" AppConsoleSendWeeklyMail1 > "NUL" 2>&1
  3.      
  4. <?php
  5. namespace AppConsoleCommands;
  6.  
  7.  
  8. use IlluminateConsoleCommand;
  9. use Mail;
  10. use AppModelsEvent;
  11. use AppModelsDiscount;
  12. use AppModelsGeneral;
  13. use AppModelsSub;
  14. use AppMailweeklyWeeklyMail1;
  15.  
  16.  
  17. class SendWeeklyMail1 extends Command
  18. {
  19.  
  20.  
  21.     protected $signature = 'emails:weekly';
  22.     protected $description = "What's new this week? send weekly emails to subbed users";
  23.  
  24.  
  25.     public function __construct()
  26.     {
  27.         parent::__construct();
  28.     }
  29.  
  30.  
  31.     public function handle()
  32.     {
  33.  
  34.         $emails = [ 'zipizape@gmail.com', 'zipizape@gmail.com', 'zipizape@gmail.com',
  35.         'zipizape@gmail.com', 'zipizape@gmail.com', 'zipizape@gmail.com',
  36.         'zipizape@gmail.com', 'zipizape@gmail.com', 'zipizape@gmail.com',
  37.         'zipizape@gmail.com', 'zipizape@gmail.com', 'zipizape@gmail.com',
  38.         'zipizape@gmail.com', 'zipizape@gmail.com', 'zipizape@gmail.com',
  39.         'zipizape@gmail.com', 'zipizape@gmail.com', 'zipizape@gmail.com' ];
  40.  
  41.         $mailData = [
  42.             'subject' => 'Ăšltimas novedades en '.env('APP_NAME'),
  43.             'events' => $events,
  44.             'discounts' => $discounts,
  45.         ];
  46.  
  47.         foreach ($emails as $email)
  48.         {
  49.             Mail::to( $email )->queue(new WeeklyMail1($mailData));
  50.         };
  51.     }
  52.  
  53.  
  54. }
  55.      
  56. protected $commands = [
  57.         'AppConsoleCommandsSendWeeklyMail1',
  58.         'AppConsoleCommandsSendBulletinMail1',
  59.     ];
  60.  
  61.  
  62.     protected function schedule(Schedule $schedule)
  63.     {
  64.         $schedule->command(SendWeeklyMail1::class);
  65.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top