An invitation sent by one person to another, either to join the site as a new member or to join a specific group or organisation. A referral records who sent it, the email address and name it was sent to, the message, and a token that uniquely identifies it in the acceptance link. Accepting a referral normally signs the recipient up and links the resulting SignupLog back to the referral; if invitedToGroup or invitedToOrg is set, the recipient is also added there. By default a referral can only be accepted once, unless isMultiAccept is true, and it stops being valid after its expiry date. Referrals raised under a promotion carry the sender's RewardEntry so the sender can be rewarded when the invitation is taken up.

Group: Database Entities

Implements: Serializable, Relational


Properties

PropertyReturnsDescription
centralLoginHashStringOne time hash returned from the central account so an invited administrator can be signed in without a password. Generated when an admin invitation is accepted, along with its time and key. Sensitive, so do not expose it outside the acceptance flow.
centralLoginHashKeyStringThe secret key used to produce and later validate the central login hash. Sensitive, and never sent to the browser.
centralLoginHashTimeLongThe time the central login hash was generated, in milliseconds since the epoch. Used to age the hash out so an old invitation link cannot be replayed.
centralLoginProfileProfileThe profile the central login hash was issued for, which is the administrator being signed in from the central account. Null when no central login has been started.
createdDateDateWhen the referral was created, which is the date the invitation was raised rather than the date it was sent or accepted. Mandatory, and the field referral listings sort on, newest first.
emailItemEmailItemThe individual email that carried this invitation, or null if no email has been sent yet. It gives access to the delivery state, so it is how you tell whether the invitation actually reached the recipient.
expiryDateDateThe date after which the invitation, and any membership it grants, is no longer valid. Stored as a date with no time component. Null means the invitation does not expire.
fromProfileProfileThe profile who sent the referral. Optional, since a referral can be raised by a process rather than a person, in which case only the sent from email address is recorded.
idlongDatabase generated primary key for this referral. Note that the token, not the id, is what identifies a referral in an acceptance link.
invitedToGroupGroupThe group the recipient joins when they accept, or null if the invitation is just to sign up. Admin invitations use this to grant the recipient an admin group on acceptance.
invitedToOrgOrganisationThe organisation the recipient's membership is granted within when they accept, or null to use the referral's own organisation. Use this when inviting somebody into a specific child organisation.
isMultiAcceptBooleanWhether the invitation link can be accepted more than once. Null is treated as false, so use multiAccept or singleAccept to test it rather than reading this directly.
messageStringPersonal message from the sender, included in the invitation email. Optional, and limited to 2000 characters.
programReferralProgramThe referral programme this invitation was raised under, or null for a one off referral. Tokens are looked up within a programme, so a lookup by token normally also supplies the programme.
respondedbooleanWhether the recipient has responded to the invitation. Set when the referral is taken up, and it stays false for invitations that were never actioned.
senderRewardEntryRewardEntryThe sender's entry in the promotion this referral was raised under, or null if the referral is not part of a promotion. It is what the sender's reward for a successful referral is credited against.
sentFromStringEmail address of the person requesting the referral be sent, used as the reply to address on the invitation. Mandatory, and taken from the sending profile when one is given.
signupSignupLogThe signup created when the recipient accepted this invitation, or null if it has not been accepted. This is the link from an invitation to the account it produced.
toEmailStringEmail address the invitation was sent to. This is the key that referral lookups by recipient match on, and it becomes the new member's email address if they accept.
tokenStringRandom UUID that authenticates the acceptance request. It appears in the invitation link, and it is the only thing proving the person following the link is the invited recipient, so treat it as a secret.
toNameStringThe name of the recipient, as entered by the sender. Display only, and used to personalise the invitation email.
websiteWebsiteThe website the referral was sent from, which determines the address the acceptance link points at. Optional, so it can be null for referrals raised outside a website.

Methods

getId() · setOrganisation(Organisation organisation) · getProgram() · setProgram(ReferralProgram program) · getWebsite() · setWebsite(Website website) · getFromProfile() · setFromProfile(Profile fromProfile) · getToName() · setToName(String toName) · getSentFrom() · setSentFrom(String sentFrom) · getToEmail() · setToEmail(String toEmail) · isResponded() · setResponded(boolean responded) · getSignup() · setSignup(SignupLog signup) · getCreatedDate() · setCreatedDate(Date createdDate) · getEmailItem() · setEmailItem(EmailItem emailItem) · getInvitedToGroup() · setInvitedToGroup(Group invitedToGroup) · getInvitedToOrg() · setInvitedToOrg(Organisation invitedToOrg) · getMessage() · setMessage(String message) · getExpiryDate() · setExpiryDate(Date expiryDate) · getToken() · setToken(String token) · getIsMultiAccept() · setIsMultiAccept(Boolean isMultiAccept) · getSenderRewardEntry() · setSenderRewardEntry(RewardEntry senderRewardEntry) · getCentralLoginHash() · setCentralLoginHash(String centralLoginHash) · getCentralLoginHashTime() · setCentralLoginHashTime(Long centralLoginHashTime) · getCentralLoginHashKey() · setCentralLoginHashKey(String centralLoginHashKey) · getCentralLoginProfile() · setCentralLoginProfile(Profile centralLoginProfile) · multiAccept() · singleAccept()

getId()

Returns: long

Database generated primary key for this referral. Note that the token, not the id, is what identifies a referral in an acceptance link.

setOrganisation(Organisation organisation)

Returns: void

Sets the organisation that owns this referral.

ParameterDescription
organisationthe owning organisation, required

getProgram()

Returns: ReferralProgram

The referral programme this invitation was raised under, or null for a one off referral. Tokens are looked up within a programme, so a lookup by token normally also supplies the programme.

setProgram(ReferralProgram program)

Returns: void

Assigns this referral to a referral programme.

ParameterDescription
programthe referral programme, or null for a one off referral

getWebsite()

Returns: Website

The website the referral was sent from, which determines the address the acceptance link points at. Optional, so it can be null for referrals raised outside a website.

setWebsite(Website website)

Returns: void

Sets the website the referral was sent from.

ParameterDescription
websitethe sending website, or null

getFromProfile()

Returns: Profile

The profile who sent the referral. Optional, since a referral can be raised by a process rather than a person, in which case only the sent from email address is recorded.

setFromProfile(Profile fromProfile)

Returns: void

Sets the profile who sent this referral.

ParameterDescription
fromProfilethe sending profile, or null

getToName()

Returns: String

The name of the recipient, as entered by the sender. Display only, and used to personalise the invitation email.

setToName(String toName)

Returns: void

Sets the recipient's display name.

ParameterDescription
toNamethe recipient's name as entered by the sender, or null

getSentFrom()

Returns: String

Email address of the person requesting the referral be sent, used as the reply to address on the invitation. Mandatory, and taken from the sending profile when one is given.

setSentFrom(String sentFrom)

Returns: void

Sets the email address of the person the invitation is sent on behalf of. Required.

ParameterDescription
sentFromthe sender's email address

getToEmail()

Returns: String

Email address the invitation was sent to. This is the key that referral lookups by recipient match on, and it becomes the new member's email address if they accept.

setToEmail(String toEmail)

Returns: void

Sets the email address the invitation is sent to.

ParameterDescription
toEmailthe recipient's email address

isResponded()

Returns: boolean

Whether the recipient has responded to the invitation. Set when the referral is taken up, and it stays false for invitations that were never actioned.

setResponded(boolean responded)

Returns: void

Records whether the recipient has responded to the invitation.

ParameterDescription
respondedtrue once the recipient has responded

getSignup()

Returns: SignupLog

The signup created when the recipient accepted this invitation, or null if it has not been accepted. This is the link from an invitation to the account it produced.

setSignup(SignupLog signup)

Returns: void

Links this referral to the signup produced by accepting it.

ParameterDescription
signupthe signup created on acceptance, or null

getCreatedDate()

Returns: Date

When the referral was created, which is the date the invitation was raised rather than the date it was sent or accepted. Mandatory, and the field referral listings sort on, newest first.

setCreatedDate(Date createdDate)

Returns: void

Sets the date the referral was created. Required.

ParameterDescription
createdDatethe creation date

getEmailItem()

Returns: EmailItem

The individual email that carried this invitation, or null if no email has been sent yet. It gives access to the delivery state, so it is how you tell whether the invitation actually reached the recipient.

setEmailItem(EmailItem emailItem)

Returns: void

Links this referral to the email that carried the invitation.

ParameterDescription
emailItemthe sent invitation email, or null

getInvitedToGroup()

Returns: Group

The group the recipient joins when they accept, or null if the invitation is just to sign up. Admin invitations use this to grant the recipient an admin group on acceptance.

setInvitedToGroup(Group invitedToGroup)

Returns: void

Sets the group the recipient is added to when they accept the invitation.

ParameterDescription
invitedToGroupthe group to join on acceptance, or null

getInvitedToOrg()

Returns: Organisation

The organisation the recipient's membership is granted within when they accept, or null to use the referral's own organisation. Use this when inviting somebody into a specific child organisation.

setInvitedToOrg(Organisation invitedToOrg)

Returns: void

Sets the organisation the recipient's membership applies within on acceptance.

ParameterDescription
invitedToOrgthe organisation to join within, or null

getMessage()

Returns: String

Personal message from the sender, included in the invitation email. Optional, and limited to 2000 characters.

setMessage(String message)

Returns: void

Sets the personal message included in the invitation email.

ParameterDescription
messagethe message text, up to 2000 characters, or null

getExpiryDate()

Returns: Date

The date after which the invitation, and any membership it grants, is no longer valid. Stored as a date with no time component. Null means the invitation does not expire.

setExpiryDate(Date expiryDate)

Returns: void

Sets the date after which this invitation and the membership it grants stop being valid.

ParameterDescription
expiryDatethe expiry date, or null for no expiry

getToken()

Returns: String

Random UUID that authenticates the acceptance request. It appears in the invitation link, and it is the only thing proving the person following the link is the invited recipient, so treat it as a secret.

setToken(String token)

Returns: void

Sets the token that authenticates acceptance of this referral. Should be an unguessable random value.

ParameterDescription
tokenthe acceptance token

getIsMultiAccept()

Returns: Boolean

Whether the invitation link can be accepted more than once. Null is treated as false, so use multiAccept or singleAccept to test it rather than reading this directly.

setIsMultiAccept(Boolean isMultiAccept)

Returns: void

Sets whether the invitation link may be accepted more than once.

ParameterDescription
isMultiAccepttrue to allow repeated acceptance, false or null for a single use invitation

getSenderRewardEntry()

Returns: RewardEntry

The sender's entry in the promotion this referral was raised under, or null if the referral is not part of a promotion. It is what the sender's reward for a successful referral is credited against.

setSenderRewardEntry(RewardEntry senderRewardEntry)

Returns: void

Links this referral to the sender's entry in the promotion that generated it.

ParameterDescription
senderRewardEntrythe sender's reward entry, or null

getCentralLoginHash()

Returns: String

One time hash returned from the central account so an invited administrator can be signed in without a password. Generated when an admin invitation is accepted, along with its time and key. Sensitive, so do not expose it outside the acceptance flow.

setCentralLoginHash(String centralLoginHash)

Returns: void

Stores the one time central login hash generated for this referral.

ParameterDescription
centralLoginHashthe hash returned from the central account, or null to clear it

getCentralLoginHashTime()

Returns: Long

The time the central login hash was generated, in milliseconds since the epoch. Used to age the hash out so an old invitation link cannot be replayed.

setCentralLoginHashTime(Long centralLoginHashTime)

Returns: void

Records when the central login hash was generated.

ParameterDescription
centralLoginHashTimethe generation time in epoch milliseconds, or null

getCentralLoginHashKey()

Returns: String

The secret key used to produce and later validate the central login hash. Sensitive, and never sent to the browser.

setCentralLoginHashKey(String centralLoginHashKey)

Returns: void

Stores the secret key used to validate the central login hash.

ParameterDescription
centralLoginHashKeythe validation key, or null to clear it

getCentralLoginProfile()

Returns: Profile

The profile the central login hash was issued for, which is the administrator being signed in from the central account. Null when no central login has been started.

setCentralLoginProfile(Profile centralLoginProfile)

Returns: void

Sets the profile the central login hash was issued for.

ParameterDescription
centralLoginProfilethe profile being signed in, or null

multiAccept()

Returns: boolean

Whether this invitation may be accepted more than once, treating an unset isMultiAccept as false. Prefer this over reading isMultiAccept directly.

singleAccept()

Returns: boolean

Whether this invitation may only be accepted once. The exact inverse of multiAccept, and true for any referral that has not explicitly been marked as multi accept.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.