Add custom cron to newsletter schedule

This commit is contained in:
JonnyWong16 2018-04-02 10:17:51 -07:00
parent a4de63095f
commit c260543586
4 changed files with 33 additions and 7 deletions

View file

@ -639,7 +639,7 @@ def dbcheck():
'CREATE TABLE IF NOT EXISTS newsletters (id INTEGER PRIMARY KEY AUTOINCREMENT, '
'agent_id INTEGER, agent_name TEXT, agent_label TEXT, '
'friendly_name TEXT, newsletter_config TEXT, email_config TEXT, '
'subject TEXT, body TEXT, cron TEXT NOT NULL DEFAULT "0 0 * * 0", active INTEGER DEFAULT 0)'
'subject TEXT, body TEXT, cron TEXT NOT NULL DEFAULT "0 0 * * 0", cron_type TEXT, active INTEGER DEFAULT 0)'
)
# newsletter_log table :: This is a table which logs newsletters sent

View file

@ -230,6 +230,7 @@ def set_newsletter_config(newsletter_id=None, agent_id=None, **kwargs):
'subject': agent_class.subject,
'body': agent_class.body,
'cron': kwargs.get('cron'),
'cron_type': kwargs.get('cron_type'),
'active': kwargs.get('active')
}