This event is triggered any time a customer refers a friend that satisfies the referral program requirements. This event is useful for sending an email thanking the customer for the referral.
Important Attributes | Description |
---|---|
email | The email address of the customer who made the referral. |
referral_code | Object has information about their overall referral stats. Useful for including an overview in an email. |
referral_code.completed_referral_customers | An array of customers they have referred so far. |
referred_customer.email | The email address of the customer they referred. |
referred_customer.first_name | The first name of the customer they referred. |
perk.reward_points | If referrer earned points, this is how many. |
redemption.reward_text | If referrer earned a coupon, this is the coupon code. |
redemption_option.name | If referrer earned a coupon, this is the discount name. |
{
"topic": "swell/referral/completed",
"name": "Swell Referral Completed",
"perk": {
"id": 9,
"campaign_id": 7,
"merchant_id": 1,
"customer_id": 139,
"reward_points": 500,
"completed": true,
"completed_at": "2016-10-15T16:02:56.142Z",
"awarded": true,
"awarded_at": "2016-10-15T16:02:56.142Z",
"pending": false,
"reversed": false,
"reversed_at": null,
"expired": false,
"expired_at": null,
"expires_at": null,
"redemption_option_id": null,
"history_title": "Refer a friend",
"created_at": "2016-10-15T16:02:56.125Z"
},
"email": "[email protected]",
"referrer": {
"total_spend_cents": 0,
"total_purchases": 0,
"perks_redeemed": 3,
"last_purchase_at": null,
"email": "[email protected]",
"referred_by": "[email protected]",
"points_earned": 5700,
"points_balance": 5200,
"points_expire_at": null,
"first_name": "John",
"last_name": "Smith",
"last_seen_at": "2016-10-15T16:01:40.000Z",
"third_party_id": "4302977345",
"referral_code": {
"code": "117yu4g",
"shares": 0,
"facebook_shares": 0,
"twitter_shares": 0,
"email_shares": 0,
"emails_sent": 0,
"emails_viewed": 0,
"links_clicked_from_email": 0,
"links_clicked_from_twitter": 0,
"links_clicked_from_facebook": 0,
"orders": 0,
"amount_cents": 0,
"average_amount_cents": 0,
"expires_at": null,
"expired": false,
"completed_referral_customers": [{
"email": "[email protected]",
"first_name": "Sally",
"last_name": "Jane",
"referral_points_contributed": 0,
"last_seen_at": "2016-10-15T16:02:51.000Z"
}],
"email": "[email protected]",
"unique_clicks": 1,
"total_clicks": 1
}
},
"referral_code": {
"id": 139,
"code": "117yu4g",
"campaign_id": 7,
"clicks": 1,
"invalid_clicks": 0,
"customer_id": 139,
"shares": 0,
"facebook_shares": 0,
"twitter_shares": 0,
"email_shares": 0,
"emails_sent": 0,
"emails_viewed": 0,
"links_clicked": 1,
"links_clicked_from_email": 0,
"links_clicked_from_twitter": 0,
"links_clicked_from_facebook": 0,
"orders": 0,
"amount_cents": 0,
"average_amount_cents": 0,
"expires_at": null,
"expired": false,
"target_referrals": null,
"customer": {
"id": 139,
"user_id": null,
"merchant_id": 1,
"total_purchases": 0,
"perks_redeemed": 3,
"last_purchase_at": null,
"is_member": false,
"email": "[email protected]",
"referred_by": "[email protected]",
"name": null,
"total_spend_cents": 0,
"subscribed": true,
"email_sent_count": 0,
"email_opened_count": 0,
"email_clicked_count": 0,
"email_bounced_count": 0,
"email_soft_bounced_count": 0,
"email_rejected_count": 0,
"email_unsubscribed_count": 0,
"email_marked_as_spam_count": 0,
"email_delayed_count": 0,
"points_earned": 5700,
"points_balance": 5200,
"source": "store_account",
"points_expiration_job_id": null,
"points_expire_at": null,
"first_name": "John",
"last_name": "Smith",
"prettyTotalSpend": "$0",
"last_seen_at": "2016-10-15T16:01:40.000Z"
},
"completed_referral_customers": [{
"email": "[email protected]",
"first_name": "Sally",
"last_name": "Jane",
"referral_points_contributed": 0,
"last_seen_at": "2016-10-15T16:02:51.000Z"
}],
"email": "[email protected]"
},
"referred_customer": {
"total_spend_cents": 2500,
"total_purchases": 1,
"perks_redeemed": 5,
"last_purchase_at": "2016-10-15T16:02:51.000Z",
"email": "[email protected]",
"referred_by": "[email protected]",
"points_earned": 450,
"points_balance": 450,
"points_expire_at": null,
"first_name": "Sally",
"last_name": "Jane",
"last_seen_at": "2016-10-15T16:02:51.000Z",
"third_party_id": "4303221377",
"referral_code": {
"code": "77jspfy",
"shares": 0,
"facebook_shares": 0,
"twitter_shares": 0,
"email_shares": 0,
"emails_sent": 0,
"emails_viewed": 0,
"links_clicked_from_email": 0,
"links_clicked_from_twitter": 0,
"links_clicked_from_facebook": 0,
"orders": 0,
"amount_cents": 0,
"average_amount_cents": 0,
"expires_at": null,
"expired": false,
"completed_referral_customers": [],
"email": "[email protected]",
"unique_clicks": 0,
"total_clicks": 0
}
}
}