Extension cron - sending email

Discussion in 'Extensions' started by stan911, May 29, 2018.

  1. stan911

    stan911 New Member

    Joined:
    May 15, 2018
    Messages:
    13
    Likes Received:
    1
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    I'm interested in sending an email on a daily basis. We're discussing the crons on this topic here but what I'm interested is how to send an email within that cron and if there are any templates I can use.
    This addresses administrator users only ( /backend ) .

    Thanks
     
  2. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    9,932
    Likes Received:
    2,325
    @stan911 - as the example at:
    PHP:
    Yii::app()->hooks->addAction('console_command_daily_after_process', function(){
        
    $users User::model()->findAll();
        foreach (
    $users as $user) {
            
    // send email here
        
    }
    });
    See /apps/backend/controllers/Customers_mass_emailsController.php for an idea on how to send in bulk.
     

Share This Page