ApexApex Training -- Notification ControllerAs you will notice, within our library class, we used dependency injection via annotations to injection the emailer class,
then called the
This will create a new PHP file at /src/core/controller/notifications/lottery.php, and will assign it to the "training" package, so upon publishing the package this PHP file will be included. Open this file, and enter the following contents:
Once the file is saved, you can visit the Settings->Notifications menu of the administration panel, and you will be able to create e-mail notifications
for our lottery package. When creating an e-mail notification, on the second page you will see a select list of available merge fields, which will include
the fields defined within the Within our library class, you will notice on line 63 we have:
This executes the emailer::process_emails() method, which will check any e-mail notifications created by the administrator, and
send out the necessary e-mail messages. Upon sending an e-mail, it will execute the above NextNext up, within our library class we also added a transaction to the winner's account. Let's go ahead and create the Transaction Controller for it next. Need a Professional?Need development work by the creator of Apex? E-mail matt.dizak@gmail.com for a free consultation. Recent NewsMailing ListSubscribe to the low traffic mailing list to stay updated on Apex. ![]() |
Apex v1.5.4 Released!
Added .env file, Remote Access Client, finalized PostgreSQL, and more...