Subscriptions Scheduling How-to

Revision: $Id$


1   What Is Subscription Scheduling

Subscription scheduling is the ability to request the CPS Portal to send mails according to the daily / weekly / monthly subscriptions.

2   How is Subscription Scheduling Done

Since Zope (CPS neither) doesn't provide Scheduler (And I think this is better like that...), you need to use crond to perform subscription scheduling.

3   Configurations

Use the script that comes with CPS in folder CPSUtil/bin; adjust the default values in the header; and run it as follows:

$ python /path/to/ --send-notifications daily

A crontab example is provided in the header of the script.

To get the list of all available options, type:

$ python /path/to/ --help

Otherwise, if you have wget installed on your *NIX to request the portal you can directly call the corresponding method as described below.

4   Daily notifications

Create a script in your /etc/cron.daily/ by issuing the following command:

cd /etc/cron.daily/
cat <<'EOF' >portal_XXX_daily_subscriptions
wget -q http://manager:password_manager@localhost:8080/cps/cps_subscriptions_schedule_notifications?subscription_mode=daily

Replace, if necessary, "manager" by the login name of a Zope user with manager role on the CPS instance, "password_manager" by its password, and "8080" by the actual port of your Zope instance, "cps" by the ID of your CPS site, and "XXX" by the name of your portal.

And, make sure that the script has execution rights. For example:

chmod +x /etc/portal_XXX_daily_subscriptions

5   Weekly notifications

Add within your /etc/cron.weekly/ the following script:

cat <<'EOF' >portal_XXX_weekly_subscriptions
wget -q http://root:pwd_root@localhost:9080/cps/cps_subscriptions_schedule_notifications?subscription_mode=weekly

(Same remark as above).

6   Monthly notifications

Add within your /etc/cron.monthly/ the following script:

cat <<'EOF' >portal_XXX_monthly_subscriptions
wget -q http://root:pwd_root@localhost:9080/cps/cps_subscriptions_schedule_notifications?subscription_mode=monthly

(Same remark as above).