Fluent builder for sending a referral invitation. Obtained from ReferralManager.newReferralBuilder, set the properties for the invitation, then call build to create and send it. Requires at least a recipient email or a target organisation or group before build is called; the sender defaults to the current logged-in profile if fromProfile is not set.

Group: Builders


Methods

canSendEmail(boolean b) · program(ReferralProgram rp) · rewardEntry(RewardEntry rp) · invitedToOrg(Organisation v) · website(Website v) · fromProfile(Profile v) · toEmail(String v) · toName(String v) · invitedToGroup(Group v) · message(String v) · token(String v) · expiryDate(Date v) · build()

canSendEmail(boolean b)

Returns: ReferralBuilder

Whether an invitation email may be sent. Defaults to true. If true, an email is still only sent when automatic email generation is enabled for the application and the referral has a recipient email.

ParameterDescription
btrue to allow sending the invitation email

program(ReferralProgram rp)

Returns: ReferralBuilder

The referral program this invitation belongs to, if any. When set, the invitation's multi-accept flag is copied from the program.

ParameterDescription
rpthe referral program the invitation belongs to

rewardEntry(RewardEntry rp)

Returns: ReferralBuilder

The reward entry to credit to the sender when the invitation is later accepted.

ParameterDescription
rpthe sender's reward entry

invitedToOrg(Organisation v)

Returns: ReferralBuilder

The organisation the recipient will be invited to join.

ParameterDescription
vthe organisation to invite the recipient to

website(Website v)

Returns: ReferralBuilder

The website the invitation is sent from. If not set, the invitation uses the current website context, or falls back to the account's external URL if there is none.

ParameterDescription
vthe website to send the invitation from

fromProfile(Profile v)

Returns: ReferralBuilder

The profile sending the invitation. If not set, defaults to the current logged-in profile.

ParameterDescription
vthe sending profile

toEmail(String v)

Returns: ReferralBuilder

The recipient's email address. Stored lower-cased. Required unless the invitation targets an organisation or group without a specific recipient.

ParameterDescription
vthe recipient's email address

toName(String v)

Returns: ReferralBuilder

The recipient's display name, used when a new profile has to be created for them.

ParameterDescription
vthe recipient's name

invitedToGroup(Group v)

Returns: ReferralBuilder

The group the recipient will be invited to join.

ParameterDescription
vthe group to invite the recipient to

message(String v)

Returns: ReferralBuilder

A personal message from the sender, included in the invitation email if one is sent.

ParameterDescription
vthe message text

token(String v)

Returns: ReferralBuilder

The token to use for the invitation link. If not set, a random UUID is generated when the invitation is built.

ParameterDescription
vthe invitation token

expiryDate(Date v)

Returns: ReferralBuilder

The date after which the invitation and any resulting membership are no longer valid.

ParameterDescription
vthe invitation's expiry date

build()

Returns: Referral

Creates and sends the referral invitation described by this builder. Equivalent to calling ReferralManager.invite with this builder.

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