Enbbox Docs

Welcome Emails

Build a welcome email workflow with Enbbox. Step-by-step tutorial for creating an automated welcome email that triggers on user signup.

A welcome email sequence is one of the most effective ways to onboard new users. Here's how to build one with Enbbox.

Create the Workflow

const welcomeSequence = workflow(
  "welcome-sequence",
  async ({ step, payload }) => {
    // Step 1: Immediate welcome email
    await step.email("welcome", async () => ({
      subject: `Welcome to ${payload.appName}, ${payload.name}!`,
      body: `<h1>Welcome aboard!</h1><p>We're thrilled to have you.</p>`,
    }));

    // Step 2: In-app welcome
    await step.inApp("welcome-inapp", async () => ({
      subject: "Welcome!",
      body: `Hey ${payload.name}, complete your profile to get started.`,
      primaryAction: {
        label: "Complete Profile",
        redirect: { url: "/settings" },
      },
    }));

    // Step 3: Wait 2 days
    await step.delay("wait-2-days", async () => ({ amount: 2, unit: "days" }));

    // Step 4: Getting started tips
    await step.email("tips", async () => ({
      subject: "3 tips to get the most out of " + payload.appName,
      body: `<h1>Getting Started Tips</h1>...`,
    }));

    // Step 5: Wait 5 more days
    await step.delay("wait-5-days", async () => ({ amount: 5, unit: "days" }));

    // Step 6: Follow-up
    await step.email("follow-up", async () => ({
      subject: "Need any help?",
      body: `<p>Hi ${payload.name}, just checking in!</p>`,
    }));
  },
);

Trigger on User Registration

// In your registration handler
await enbbox.trigger("welcome-sequence", {
  to: { subscriberId: user.id },
  payload: {
    name: user.firstName,
    appName: "Your App",
    email: user.email,
  },
});

On this page