Starting from version 1.2.6 Smart Subscriptions component supports scanning of active subscriptions, automatic reset to free account for expired subscriptions and email notifications to users when their subscriptions are about to expire. In earlier versions of the component subscriptions were validated only when users logged in. If a subscription was expiring soon a reminder was displayed in message area, if a subscription had already expired it was reset to a free account allowing the user to login and purchase another subscription.

With a cron task running periodically subscriptions are maintained up to date not depending on user login activity, i.e. expired subscriptions are reset to free account immediately and users receive email notification about their subscription update. Reminder emails about soon account expiration are sent when cron task detects active subscriptions which are about to expire.

There are two modes to trigger Smart Subscriptions cron job:

  1. via URL: http://yourdomain.com/index.php?option=com_smartsub&task=notifications.webcron&api_key=secret
  2. via command line: /usr/bin/php /path/to/site/cli/smartsub_cron.php

(as a quick reference you can open component settings in Joomla administration interface and go to "Cron Job" pane).

The first mode suits well for external webcron service (e.g. cron-job.org), server cron scheduler if your hosting permits running URL cron tasks or for triggering cron job manually via you browser (perfect for testing).

The second mode is designed for running a cron job from command line, that is in terms of a live hosting - running a cron job that executes a php script. Command line script smartsub_cron.php must be previousely moved from /components/com_smartsub/controllers to /cli folder, otherwise it will not run correctly.

Ask your hosting provider advice about scheduling cron jobs.

It is recommended to schedule cron task to execute frequently, e.g. every 5 or 10 minutes. The fact that emails are sent during the cron task makes it quite time-consuming. That is why cron script sets a limit of maximum 10 users to process on each script execution so that you never exceed maximum PHP execution time. If you have more than 10 active subscriptions that require an action (account reset or "expires soon" notification) they will be processed in chunks of 10 on next cron execution. Running cron task frequently will keep your users up to date and doesn't lead to emails duplication: email notifications will be sent only once per user.

You will have to configure Smart Subscriptions component depending on how you are going to trigger cron task. For the first mode "API key" setting is required and must coincide with "&api_key=" parameter in the URL. For the second mode you have to provide current site URL: command line script is agnostic about your domain URL and "Site URL" option is important for displaying correct links to your site and logo images in email notifications (command-line cron will not run at all if you leave site URL option in blank).

See component global options for details on other settings in "Cron Job" pane (coming soon).