ReferralsRepository
The ReferralsRepository interface invokes and
manages referral-related REST API requests. Use this class to interact with the Salesforce
Referral Marketing APIs and manage referral-related operations.
Methods
enrollNewCustomerAsAdvocateOfPromotion
Enroll a new member to a given promotion.
1val result: ApiResponse<ReferralEnrollmentResponse> = repository.enrollNewCustomerAsAdvocateOfPromotion(firstName = "John",
2 lastName = "Doe",
3 email = "john.doe@example.com",
4 promotionName = "Referral Program",
5 promotionCode = "PromoCode"
6 )| Parameter | Type | Description |
|---|---|---|
| country | String | The name of the country of the member. |
| String | Required. The email ID of the member. | |
| enrollmentChannel | String | Channel used to join the referral program. Possible values are:
|
| firstName | String | Required. The first name of the member. |
| lastName | String | Required. The last name of the member. |
| memberStatus | String | Status of the new advocate after enrollment. Possible values are:
|
| promotionName | String | Required. The promotion name to enroll for. |
| promotionCode | String | Required. The promotion code to enroll for. |
| state | String | The name of the state of the member. |
| transactionalJournalFrequency | String | Frequency at which transaction statements must be generated for the advocate.
Possible values are:
|
| transactionalJournalMethod | String | Preferred method of receiving transaction journal statements. Possible values are: |
enrollExistingAdvocateToPromotionWithMembershipNumber
Enroll an existing member to a given promotion using the membership number.
1val result: ApiResponse<ReferralEnrollmentResponse> = repository.enrollExistingAdvocateToPromotionWithMembershipNumber(
2 promotionName = "Referral Program", promotionCode = "PromoCode", membershipNumber = "1234567890"
3 )| Parameter | Type | Description |
|---|---|---|
| promotionName | String | Required. The promotion name to enroll for. |
| promotionCode | String | Required. The promotion code to enroll for. |
| membershipNumber | String | Required. The membership number of the existing member. |
enrollExistingAdvocateToPromotionWithContactId
Enroll an existing member to a given promotion using the contact ID.
1val result: ApiResponse<ReferralEnrollmentResponse> = repository.enrollExistingAdvocateToPromotionWithContactId(
2 promotionName = "Referral Program", promotionCode = "PromoCode", contactId = "0c12sed3456kpPl"
3 )| Parameter | Type | Description |
|---|---|---|
| promotionName | String | Required. The promotion name to enroll for. |
| promotionCode | String | Required. The promotion code to enroll for. |
| contactId | String | Required. The contact ID of the existing member. |
enrollExistingAdvocateToNewPromotion
Enroll an existing member to a new promotion.
1val result: ApiResponse<ReferralEnrollmentResponse> = repository.enrollExistingAdvocateToNewPromotion(
2 promotionName = "Referral Program", promotionCode = "PromoCode""
3 )| Parameter | Type | Description |
|---|---|---|
| promotionName | String | Required. The promotion name to enroll for. |
| promotionCode | String | Required. The promotion code to enroll for. |
sendReferrals
Send referral emails to the given recipients.
1val eventOutput: ApiResponse<ReferralEventResponse> = repository.sendReferrals(referralCode = "ReferralCode", emails = listOf("john.doe@example.com")| Parameter | Type | Description |
|---|---|---|
| referralCode | String | Required. The referral code to share with the recipients. |
| emails | List<String> | Required. A list of recipient emails to share the referral code with. |