You all are probably familiar with this one. The "invite a friend" campaign is the one where a friend invites a friend to sign up for something and if they do - they can both get benefits! Thanks to the block-magic in Loopify's flow, it's all easy and possible. 😄
This campaign consists of 2 different Flows - one main and one temporary.
Note: You can use only 2 contacts to create the initial setup of the three Flows. After the basic setup is finished - you can then use the Flow campaigns with real contacts.
Flow 1 - Setting up the campaign
New Entry --> Email;
Page --onFormSubmit--> Connect;
External Form ---> Email
Custom contact field needed:
text field named "Who invited you?"
text field named "Last friend that accepted your invitation"
- Set it to read-only (so its value can be seen but not changed)
- Map it to the previously-created custom contact field named 'Who invited you?'
- Under Default Value of the field, toggle on the Pre-Populate Value Using URL Parameter
- Add 'email' as the Parameter name. This way, the friend can see your email i.e. the person that invited them.
You can extra follow-up blocks after the page is submitted, like an email or even send them to a new campaign, so the friend would continue their journey with the sign-up or whichever the purpose of your campaign is.
Moving on, connect the New Entry to Email. In the email, add a link to an email that links to a placeholder email like "email@example.com". On the actual send, the original contact can change this placeholder and add more emails (friends) to the receivers list if they want to. In the Advanced Options of this 'link to an email', add a Subject, Body, and toggle on the Create Short URL. In the Full URL field, paste the Public page link from the Page block we already made. In this pasted link, add an email variable, after the "?email=" text. It should look like this: "?email=Email&..."
When the page is submitted, the contact will be sent to the Connect block, but let's move on to the second Flow.
Flow 2 - Temporary flow for setting up the External Form
New Entry --> Connect (webhook).
Create your Flow 2 in a new tab. Briefly go back to Flow 1, click Start Mapping on the External Form and Copy Map URL. Perfect! Back to Flow 2.
Click the Connect block and paste the URL to the To Callback URL field. Under including contact fields, add the contact fields: Email, Who Invited you? and Last accepted that accepted your invitation. Under add fixed field, add a field named secret with a value of your choice. The field must be named 'secret' - so the call can work.
You can now go Live with this Flow. While you have both tabs open, send in the original contact (via the New Entry block it has) in Flow 2. Doing so will open the mapping window of the External Form in the Flow 1 tab.
Note: The original contact that you send must have values for the three fields we added in the Connect block. Otherwise, the mapping modal won't open.
Now, map the original fields to the friend's fields. This is done in order to reverse the connection.
Map the fields like this:
Email -> Last friend that accepted your invitation
Who invited you -> Email
Last friend that accepted your invitation -> Who invited you
Here's a screenshot of how to map:
When the mapping is done correctly, you'll see the API Trigger URL of the External Form.
Click Copy Trigger URL and paste the URL in the To callback URL field of the Connect block in Flow 1. We are done with Flow 2 (can be deleted) and when you want real contacts in, just send them to Flow 1 and the rest of the campaign will run smoothly. Awesome!
Lastly, the email below the External Map block will be sent to the original contact, notifying them that their friend has successfully accepted their invitation. This email can contain something like "Yay! Your friend LastFriendThatAcceptedInvitation has accepted your invitation!" (the blue text being a variable). The variable will convert to the friend's name because we have reversed the connection.
We made it! 👏 Now that you know how the setup up works, you can create countless 'recruit a friend' examples where friendship truly shines!