A scheduled reminder email for a CalEvent, sent a set period before the event starts. The interval is expressed as a unit and a multiple, for example 3 with a unit of DAYS, and is subtracted from the event's start date to work out when the reminder falls due, so a negative multiple schedules it after the event instead. A reminder is meant to run once: the background job collects reminders that are enabled, have no processedDate and are due, and processedDate is stamped once it has run, so a reminder with that column set is never picked up again. If themeSite is set, the email is rendered using that website's live theme.

Group: Database Entities

Implements: Serializable


Properties

PropertyReturnsDescription
createdDateDateWhen this reminder was created. Required.
enabledbooleanWhether this reminder is active. Disabled reminders are skipped when due reminders are collected, so switching this off is how a reminder is suspended without deleting it.
eventCalEventThe event this reminder belongs to. Required, and its start date is what the reminder's due date is calculated from.
htmlStringHTML body of the reminder email, up to 100000 characters.
idlongThe database-assigned unique identifier for this reminder.
processedDateDateWhen this reminder was sent, or null if it has not been processed yet. Only reminders with a null value here are collected as due, so a reminder that has run will not run again unless this is cleared.
subjectStringSubject line used for the reminder email.
themeSiteWebsiteWebsite whose live theme supplies the email template used to render this reminder. Null to fall back to the default template.
timerMultipleIntegerHow many of the timer units before the event the reminder is sent, for example 3 with a unit of DAYS. Null means no due date can be worked out, so the reminder never fires.
timerUnitTimeUnitThe unit the reminder interval is measured in: HOURS, DAYS, WEEKS, MONTHS or ANNUAL. Null means no due date can be worked out, so the reminder never fires.

Methods

getId() · getEvent() · getThemeSite() · getTimerUnit() · getTimerMultiple() · getSubject() · getHtml() · getEnabled() · getCreatedDate() · getProcessedDate() · due(Date now) · dueDate(Date eventDate)

getId()

Returns: long

The database-assigned unique identifier for this reminder.

getEvent()

Returns: CalEvent

The event this reminder belongs to. Required, and its start date is what the reminder's due date is calculated from.

getThemeSite()

Returns: Website

Website whose live theme supplies the email template used to render this reminder. Null to fall back to the default template.

getTimerUnit()

Returns: TimeUnit

The unit the reminder interval is measured in: HOURS, DAYS, WEEKS, MONTHS or ANNUAL. Null means no due date can be worked out, so the reminder never fires.

getTimerMultiple()

Returns: Integer

How many of the timer units before the event the reminder is sent, for example 3 with a unit of DAYS. Null means no due date can be worked out, so the reminder never fires.

getSubject()

Returns: String

Subject line used for the reminder email.

getHtml()

Returns: String

HTML body of the reminder email, up to 100000 characters.

getEnabled()

Returns: boolean

Whether this reminder is active. Disabled reminders are skipped when due reminders are collected, so switching this off is how a reminder is suspended without deleting it.

getCreatedDate()

Returns: Date

When this reminder was created. Required.

getProcessedDate()

Returns: Date

When this reminder was sent, or null if it has not been processed yet. Only reminders with a null value here are collected as due, so a reminder that has run will not run again unless this is cleared.

due(Date now)

Returns: boolean

Whether the reminder has fallen due as at the time given, that is whether the due date worked out from the event's start date and the configured interval is already in the past. Returns false when the event has no start date or the interval has not been fully configured.

ParameterDescription
nowthe time to test the due date against

dueDate(Date eventDate)

Returns: Date

Works out when this reminder falls due for an event starting at the date given, by subtracting the configured interval from it. Note that it takes the event date as an argument rather than reading the event, so it can be used to preview a due date for any start time.

ParameterDescription
eventDatethe event start date to calculate from
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.