Anonymous Invite Emails

You can send emails to people you haven’t already added to your workspace using anonymous events and an event-triggered campaign.

 You can now add people just using their email!

Our default workspace settings now treat email as a unique identifier for people—each email address represents a person. Rather than setting up an anonymous email, you can now add a person to your workspace, and then invite them to become a customer! This provides a simplified way to track and message people before they become customers.

If your workspace doesn’t support email as an identifier, contact migrations@customer.io about migrating to a workspace that does!

This lets you send emails like:

From: Jo at CoolApp <jo@coolapp.com>
To: alex@example.com  
Subject: Exclusive invitation: CoolApp beta, just launched!  

Hey Alex,

As a registered OldApp beta tester, we'd like to invite you to try out our new CoolApp! Click here to get started.

The CoolApp Team
If you want to allow people in your workspace to invite their friends, try our Invite Emails recipe instead.

Ingredients and Process

To complete this recipe, you need:

There are two ways you can approach this process:

  • Preferred: Add a person by email, and trigger an invitation campaign. We prefer this method because you can send an invite and track a person’s response. This path only works if your workspace supports email as a unique identifier.
  • Send an anonymous event that triggers a campaign without adding a person. This lets you send an email to a person who doesn’t belong to your workspace (referencing them using the recipient field in your event), but you won’t be able to track the performance of your message or remember this person for future campaigns.

The Invite Event

For our example campaign, imagine that we’re sending an invite email about a new app that we want people to beta test. We’re calling our event beta_test_invite and including all the data we’ll need to customize our message. This is the payload of our event.

{
   "name":"beta_test_invite",
   "data": {
      "firstname": "Alex", 
      "source":"oldApp", 
      "recipient":"alex@example.com"
   }
}

If you’re sending an anonymous event, your event must include a recipient field containing the email address you want to send your message to. If you’re adding a person to your workspace by email address—which we prefer—you’ll use the recipient field as the email address in the path of your request—e.g. https://track.customer.io/api/v1/events/alex@example.com

In general, your integration should send event data using our API. But, to demonstrate this particular recipe, you can open your terminal and send individual events to Customer.io using the cURL examples in the processes below.

If your request is successful, your event appears in your Activity Logs.

anonymous event
anonymous event

Preferred: Add a person by email and send an invite

As a part of this process, you will use an event to add a person to your workspace by email, and trigger a campaign from the same event!

Because events can add people, you can send a standard, non-anonymous event. If the person in your workspace doesn’t already exist, we’ll add them. You’ll trigger a campaign from this same event, inviting people to use your service, become customers, or another conversion goal.

  1. Create an event triggered campaign, with beta_test_invite as the event trigger. We recommend setting Sending Behavior to Draft, so that you can test your campaign before you send any messages. When you verify that everything is set up correctly, you can send the drafts and set the campaign to Send Automatically.

    trigger event
    trigger event

  2. Drag an email into your workflow and add your content. Remember, you can access properties in the event using {{event.<property>}}. In this case, you might want to address a person as {{event.first_name}}.

  3. (Optional) Add an Attribute Change to your campaign to assign properties from the event as attributes on your new person—like the first_name attribute (assign a value from the event using {{event.<property>}})!

  4. Start your campaign send an event to trigger it. Because you know the email address of the person you want to invite, you’ll send your event using that email address.

    curl -i https://track.customer.io/api/v1/customers/{recipient_email_address}/events \
    -X POST \
    -u YOUR-SITE-ID-HERE:YOUR-SECRET-API-KEY-HERE \
    -d name=beta_test_invite \
    -d data[source]=OldApp \
    -d data[first_name]=CUSTOMER-FIRST-NAME-HERE \
    
  5. Go to Deliveries & Drafts and find the draft triggered by the event you sent. Make sure that your message contains the information you expect. Don’t forget to try all of your event data permutations to make sure that your email works for different values in your anonymous event.

    You might also want to check that your event added a person to your workspace with the data you expect, including any attributes that you set as a part of the campaign.

When you’re ready, change your email’s Sending Behavior to Send Automatically, and send all your drafts. All done!

Send an anonymous invite

If your workspace supports email as an identifier, we strongly recommend using the process above to add a person by email address and send them an event-triggered invite campaign. This lets you track the performance of your message and remain aware of this person if you see them in future events.
  1. Create an event triggered campaign, with beta_test_invite as the event trigger. We recommend setting Sending Behavior to Draft, so that you can test your campaign before you send any messages. When you verify that everything is set up correctly, you can send the drafts and set the campaign to Send Automatically.

    trigger event
    trigger event

  2. Drag an email into your workflow and add your content. Use liquid in the {{event.<property>}} scope to reference fields from the event that triggers your campaign. When you’re done, click Layout & Preview to see your message, fully populated with data from the event you sent in previous steps.

     The To field must contain {{event.recipient}}

    Your event must contain a recipient key, and your message must go to that address; you can’t reference another event key in your message.
    anonymous invitation editor
    anonymous invitation editor

  3. Start your campaign and send an event to trigger your campaign.

     Do not include an anonymous ID with your event

    Events with an anonymous_id will not trigger invite campaigns.

    curl -i https://track.customer.io/api/v1/events \
     -X POST \
     -u YOUR-SITE-ID-HERE:YOUR-SECRET-API-KEY-HERE \
     -d name=beta_test_invite \
     -d data[first_name]=Alex \
     -d data[source]=OldApp \
     -d data[recipient]=alex@example.com
    
  4. Go to Deliveries & Drafts and find the draft triggered by the event you sent. Make sure that your message contains the information you expect. If not, edit your campaign email and check the draft again. Don’t forget to try all of your event data permutations to make sure that your email works for different values in your anonymous event.

When you’re ready, change your email’s Sending Behavior to Send Automatically, and send all your drafts. All done!

Wrap Up

Anonymous events are a little tricky, but a great way to bring new users into your application. We generally recommend using normal events to invite friends whenever you can, as it’s much easier to get started.

If you have any problems or questions about this topic, contact us for help!

Copied to clipboard!