Bento

Written lesson

This lesson is text-only. Use the guide below to work through it.

Example: Event-Driven Lead Magnet Fulfillment

Fulfill a lead magnet automatically when someone opts in.

Scenario

Someone opts in to get a free resource. A checklist, a PDF, a template, a swipe file. The moment they opt in, you want that resource in their inbox without you lifting a finger.

This is the simplest event-driven example in Bento, and it is a great first one to build. One event comes in, one flow reacts, one email goes out.

This is instant delivery. If you want to drip a multi-day course instead, that is the Automated Daily Email Course example, which is a different pattern and comes later in this section.


Prerequisites


Trigger and data

The flow starts when a lead magnet opt-in event comes in.

Here is an example event. The name is an example naming choice, so use whatever fits your account, as long as you stay consistent.

{ "type": "lead_magnet_requested", "email": "subscriber@example.com", "details": { "magnet_name": "SEO Checklist", "download_url": "https://yoursite.com/downloads/seo-checklist.pdf" }, "fields": { "first_name": "Jordan" } }

A few notes on this payload:

  • type is the event name. The $ prefix is optional, as covered in the Events & Flows Overview. lead_magnet_requested and $lead_magnet.requested both work.
  • details carries data about this opt-in. The magnet name and the download link live here because you only need them inside this flow.
  • fields carries data about the person. When the event arrives, Bento creates the subscriber if they do not exist yet and writes these fields to their profile.

If you need the download link in a later flow or email, store it as a subscriber field. Event details stay attached to the event, but they are not stored on the subscriber profile. For this immediate delivery flow, details are enough.


Flow shape

  • Trigger: Event Received, listening for lead_magnet_requested.
  • Step 1: Add Tag, so you can see who requested which magnet.
  • Step 2: Send Email, delivering the resource right away with no delay.

That is the whole core flow. Delivery is instant because there is no delay step between the trigger and the email.


Build steps

1 - Decide your event name and payload

Pick your event name and the details it will carry. At minimum you want the magnet name and the download link. Keep the name consistent with the rest of your account.


2 - Send the event when someone opts in

Fire the event when the opt-in happens. This can come from a Bento-powered form, your backend through the API or an SDK, or a third-party tool. The Behavior-Based Emails lesson covers each of these paths.

Whatever fires it, make sure it includes the subscriber's email and the details above.


3 - Create the flow with an event trigger

Go to Flows and create a new flow. Name it something like "Lead Magnet - SEO Checklist."

For the trigger, choose Event Received and set it to listen for lead_magnet_requested.

Leave it in Draft while you build.


4 - Add a tag

Add an Add Tag action after the trigger.

A static tag like Flag - Lead Magnet works fine. If you offer several magnets, a dynamic tag is handy:

Lead Magnet - {{ event.details.magnet_name }}

This creates tags like Lead Magnet - SEO Checklist, so you can segment by which resource someone wanted.


5 - Add the delivery email

Add a Send Email action after the tag. This is the email that delivers the resource.

Use both visitor and event data, with a default on anything that might be empty.

Subject:

Here's your {{ event.details.magnet_name | default: "download" }}, {{ visitor.first_name | default: "friend" }}

Body:

Hey {{ visitor.first_name | default: "there" }}, Thanks for grabbing the {{ event.details.magnet_name | default: "resource" }}. {% if event.details.download_url %} You can download it here: {{ event.details.download_url }} {% else %} Reply to this email and we will send you the download link. {% endif %} Enjoy, Your Name

The | default: filter matters. If a subscriber has no first name set, they still get a clean line instead of a blank space.


6 - Build a test trigger chain

Use the same test pattern from the Flow With Events, Tags, Fields, & Emails lesson.

Add a second trigger to the canvas: Event Received, listening for test_lead_magnet.

Connect it to a single Create Event action that fires lead_magnet_requested with dummy details:

{ "magnet_name": "SEO Checklist", "download_url": "https://yoursite.com/downloads/seo-checklist.pdf" }

Now you can test the whole flow by firing one simple event on a test subscriber, without needing an external tool.


Test

Publish the flow, then use Bento's flow test suite.

In the flow editor, choose Start a task, then Test, then Manually add user.

Enter a test email you can check, choose your test_lead_magnet trigger, and run it.

Watch the event move through each step. You should see:

  • The tag applied to the subscriber
  • The delivery email arrive with the magnet name and download link filled in

If the test email belongs to an existing subscriber with a first name, you will see their name. Otherwise you will see the "friend" and "there" fallbacks, which is exactly what the defaults are for.


Customize

  • Swap the magnet name, download link, and copy for your own resource.
  • Change the tag to match your naming.
  • Add a Set Field action if you want the magnet name stored on the profile for later use.
  • Add a delay and a follow-up email if your delivery flow needs one.
  • If you offer several magnets from one flow, split on {{ event.details.magnet_name }} to send the right resource. Splits are covered in the How To Use Liquid In Bento lesson.

Safety checks

  • Confirm there is no delay before the delivery email, so the resource arrives right away.
  • Confirm the event includes a valid download URL before you activate the flow.
  • Use a default on every personalization tag that could be empty.
  • Set any older test flows that listen for the same event to Draft, so you do not double-send.
  • After a test run, open the subscriber's profile and confirm the tag landed and the event shows the details you expect.

When to move on

  • You send an event when someone opts in, with the magnet name and download link in details
  • You have a flow triggered by that event that tags the subscriber and sends the resource
  • The delivery email uses {{ visitor.* }} and {{ event.details.* }} with safe defaults
  • There is no delay, so delivery is instant
  • You built a test trigger chain and tested the flow end to end
  • You understand why the download link lives in event details here, and when you would also store it on the subscriber profile