Experimental project

This is a sandbox project, which contains experimental code for developer use only.

Use cron queue to load users and check their card's expiration status.

If a card will expire in one of user defined set of dates this module triggers a rules event called "Users card expiration", this event receives the user object and the amount of days until expiration, so its easy to add email action with necessary info.

Depends on reliable daily cron execution.

Cronjob only runs once a day via a cron last run variable, but cron itself should run often enough to clear the queue up.

Rules will look something like this

{ "rules_card_is_expired" : {
    "LABEL" : "Card is expired",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules", "cardonfile_expiration" ],
    "ON" : [ "cardonfile_expiration_card_expiring" ],
    "IF" : [
      { "data_is" : { "data" : [ "expires" ], "op" : "\u003C", "value" : "0" } }
    ],
    "DO" : [
      { "mail" : {
          "to" : [ "user:mail" ],
          "subject" : "Scanther: Your card has expired",
          "message" : "Our records indicate your card has expired. Please update your card \u003Ca href=\u0022www.scanther.com\/user\/[user:uid]\/cards\u0022\u003Ehere\u003C\/a\u003E.",
          "language" : [ "" ]
        }
      }
    ]
  }
}


{ "rules_card_will_expire" : {
    "LABEL" : "Card will expire",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules", "cardonfile_expiration" ],
    "ON" : [ "cardonfile_expiration_card_expiring" ],
    "IF" : [
      { "data_is" : { "data" : [ "expires" ], "op" : "\u003E", "value" : "0" } }
    ],
    "DO" : [
      { "mail" : {
          "to" : [ "user:mail" ],
          "subject" : "Your card will expire soon.",
          "message" : "Our records indicate your card will expire in [expires:value] days. Please update your card \u003Ca href=\u0022www.scanther.com\/user\/[user:uid]\/cards\u0022\u003Ehere\u003C\/a\u003E",
          "language" : [ "" ]
        }
      }
    ]
  }
}

Sponsored by www.scanther.com

Project information