Hello world, but with scheduled email sending
Goal
We want to add scheduled email sending to an Hello World Application already hosted on Poja. Our goal is to automatically send a daily email to a specified email address using Poja’s Scheduled Tasks feature
How-to in 2 steps
Step 1: Implement the email sending code
Because Scheduled Tasks are asynchronous, we first have to implement the email sending feature as standard for asynchronous tasks.
Let’s update our configuration’s Worker to enable scheduled tasks:

Next let’s create our Event class and event consumer:
To trigger a deployment, just commit and push the code to the preprod branch of the repository.
Step 2: Make the email sending automatic everyday
Now that we have our email sending code, all we have to do is to update our configuration using the Scheduled Tasks menu:

Save the configuration and wait for the deployment to complete, and voilà!
Last updated
Was this helpful?
