Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- C:xampphtdocsdtcburger.com>php artisan schedule:run
- Running scheduled command: "C:xamppphpphp.exe" "artisan" AppConsoleSendWeeklyMail1 > "NUL" 2>&1
- <?php
- namespace AppConsoleCommands;
- use IlluminateConsoleCommand;
- use Mail;
- use AppModelsEvent;
- use AppModelsDiscount;
- use AppModelsGeneral;
- use AppModelsSub;
- use AppMailweeklyWeeklyMail1;
- class SendWeeklyMail1 extends Command
- {
- protected $signature = 'emails:weekly';
- protected $description = "What's new this week? send weekly emails to subbed users";
- public function __construct()
- {
- parent::__construct();
- }
- public function handle()
- {
- $emails = [ 'zipizape@gmail.com', 'zipizape@gmail.com', 'zipizape@gmail.com',
- 'zipizape@gmail.com', 'zipizape@gmail.com', 'zipizape@gmail.com',
- 'zipizape@gmail.com', 'zipizape@gmail.com', 'zipizape@gmail.com',
- 'zipizape@gmail.com', 'zipizape@gmail.com', 'zipizape@gmail.com',
- 'zipizape@gmail.com', 'zipizape@gmail.com', 'zipizape@gmail.com',
- 'zipizape@gmail.com', 'zipizape@gmail.com', 'zipizape@gmail.com' ];
- $mailData = [
- 'subject' => 'Últimas novedades en '.env('APP_NAME'),
- 'events' => $events,
- 'discounts' => $discounts,
- ];
- foreach ($emails as $email)
- {
- Mail::to( $email )->queue(new WeeklyMail1($mailData));
- };
- }
- }
- protected $commands = [
- 'AppConsoleCommandsSendWeeklyMail1',
- 'AppConsoleCommandsSendBulletinMail1',
- ];
- protected function schedule(Schedule $schedule)
- {
- $schedule->command(SendWeeklyMail1::class);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement