A bulk SMS send addressed to one or more groups of profiles, the SMS equivalent of a group email job. The job holds the message text, the provider to send through, and a list of GroupRecipient rows naming the groups to include or exclude; an optional filter script narrows the audience further. A job moves through the status constants on this class, starting as a draft and being picked up by the SMS dispatcher once it is set to ready to send, which then expands the groups into one SmsItem per recipient. Deletion is soft: the deleted flag is set and the name is suffixed with a timestamp so the original name can be reused.

Group: Database Entities

Implements: Serializable


Properties

PropertyReturnsDescription
createdByProfileThe profile that created the job.
createdDateDateWhen the job was created. Note that a job produced by the duplicate method carries over the original's created date rather than being stamped afresh.
deletedbooleanWhether the job has been soft deleted. The finders on this class skip deleted jobs, but they remain in the database along with their sent items.
deletedByProfileThe profile that deleted the job.
deletedDateDateWhen the job was deleted.
filterScriptXmlStringAn optional filter, stored as XML, narrowing the audience beyond the chosen groups. Null means every member of the included groups is sent to.
groupRecipientsList<GroupRecipient>The groups this job is addressed to. Each entry is either an inclusion or an exclusion, so the audience is the members of the included groups minus the members of the excluded ones.
idlongDatabase identifier for this SMS job.
nameStringPath-safe identifier for the job, unique among the account's undeleted jobs and used to look it up. Deleting a job appends a timestamp to its name so the original name becomes free again. See getTitle for the human readable label.
notesStringFree text notes about the job, for whoever picks it up next. A duplicated job gets a note recording the name it was copied from.
sendingOrgOrganisationThe account the job belongs to and is sent on behalf of. Job names are unique within this account, and the dispatcher uses it to decide which cluster picks the job up.
smsMsgStringThe message body sent to each recipient, up to 1000 characters. Longer messages are split into multiple parts by the provider and charged accordingly.
smsProviderStringWhich configured SMS gateway the job is sent through. Null means the account's default provider.
statusStringWhere the job is up to, as one of the single character status constants on this class: draft, ready to send, in progress, completed or failed. Setting it to ready to send is what queues the job for the dispatcher.
statusDateDateWhen the status was last changed, so a stuck job can be spotted.
titleStringDisplay label for the job shown in the admin console. Free text, with no uniqueness guarantee; use the name for lookups.

Methods

getId() · getSendingOrg() · getCreatedDate() · getCreatedBy() · getGroupRecipients() · getStatus() · getStatusDate() · getSmsMsg() · getSmsProvider() · getDeleted() · getDeletedBy() · getDeletedDate() · getName() · getTitle() · getNotes() · getFilterScriptXml() · addGroupRecipient(Group g, boolean exclusion)

getId()

Returns: long

Database identifier for this SMS job.

getSendingOrg()

Returns: Organisation

The account the job belongs to and is sent on behalf of. Job names are unique within this account, and the dispatcher uses it to decide which cluster picks the job up.

getCreatedDate()

Returns: Date

When the job was created. Note that a job produced by the duplicate method carries over the original's created date rather than being stamped afresh.

getCreatedBy()

Returns: Profile

The profile that created the job.

getGroupRecipients()

Returns: List<GroupRecipient>

The groups this job is addressed to. Each entry is either an inclusion or an exclusion, so the audience is the members of the included groups minus the members of the excluded ones.

getStatus()

Returns: String

Where the job is up to, as one of the single character status constants on this class: draft, ready to send, in progress, completed or failed. Setting it to ready to send is what queues the job for the dispatcher.

getStatusDate()

Returns: Date

When the status was last changed, so a stuck job can be spotted.

getSmsMsg()

Returns: String

The message body sent to each recipient, up to 1000 characters. Longer messages are split into multiple parts by the provider and charged accordingly.

getSmsProvider()

Returns: String

Which configured SMS gateway the job is sent through. Null means the account's default provider.

getDeleted()

Returns: boolean

Whether the job has been soft deleted. The finders on this class skip deleted jobs, but they remain in the database along with their sent items.

getDeletedBy()

Returns: Profile

The profile that deleted the job.

getDeletedDate()

Returns: Date

When the job was deleted.

getName()

Returns: String

Path-safe identifier for the job, unique among the account's undeleted jobs and used to look it up. Deleting a job appends a timestamp to its name so the original name becomes free again. See getTitle for the human readable label.

getTitle()

Returns: String

Display label for the job shown in the admin console. Free text, with no uniqueness guarantee; use the name for lookups.

getNotes()

Returns: String

Free text notes about the job, for whoever picks it up next. A duplicated job gets a note recording the name it was copied from.

getFilterScriptXml()

Returns: String

An optional filter, stored as XML, narrowing the audience beyond the chosen groups. Null means every member of the included groups is sent to.

addGroupRecipient(Group g, boolean exclusion)

Returns: GroupRecipient

Adds a group to this job's recipient list, creating the recipient collection if it does not exist yet. The new GroupRecipient is attached to the job in memory but is not saved, so the caller must persist either it or the job.

ParameterDescription
gthe group to include in or exclude from the audience
exclusiontrue to exclude the group's members, false to include them
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.