Can anyone help with some tips on how to queue email using an OctoberCMS ajax page?
function sendRecipientMsg($dataset, $sendCounter, $recipients){
$template = $dataset['template'];
Mail::queue($template, $dataset, function($message) use($dataset, $recipients){
$message->to('piggy@teamprema.co.nz','MissPiggy');
$message->subject('Have a good day');
$message->from('us@prema.co.nz', 'Mike and Stephie');
$message->sender('us@prema.co.nz', 'Mike and Stephie');
trace_log('$message');
$message->cc($address, $name = null);
$message->bcc('systems@safe.org.nz', 'SAFE Campaigns Feedlots ECards');
});
}
This code works when we use Mail::send but not with Mail::queue
Any help or tips very welcome