Scheduler demo
Tags: #naas #scheduler #snippet
Author: Jeremy Ravenel
Read the doc: https://naas.gitbook.io/naas/features/scheduler
Transform all your work routines in notebooks and run them even when you sleep.

Input

Import library

1
import naas
Copied!
Here we are going to use the Notifications feature to test Scheduler.

Model

Content of the mail

1
email_to = "[email protected]"
2
subject = "Naas Scheduler Test"
3
content ='''<p>If i put html in there..&nbsp;</p>
4
<p><img src="https://specials-images.forbesimg.com/imageserve/5f1f37a40a5db2c8275972c0/960x0.jpg?fit=scale" alt="" width="959" height="663" /></p>'''
Copied!

Output

Send the email

1
naas.notifications.send(email_to, subject, content)
Copied!

Setting up the scheduler

1
naas.scheduler.add(recurrence="0 1 * * *")
Copied!
Copy link
Edit on GitHub