Retention

Milestone celebration email and push

A short note on a user’s 10th, 100th and 1,000th document, by push to their newest device and by email, with the 1,000th also reported to the product team in Slack.

EmailPushSlacktrigger.eventpayload wherepayload refstimeWindowbranchreentry: concurrentSlack
import { eq, inArray, trigger, workflow } from 'sendwend';
import { e, u } from './contract';
import { email, push, slack } from './templates';

/**
 * Only the document that crosses a milestone starts the journey; every
 * other one is ignored.
 */
const milestone = trigger.event(e.doc_created, (p) =>
  inArray(p.count, [10, 100, 1000])
);

/**
 * Milestone celebration: the 10th, 100th and 1,000th document each get
 * a short note, on the phone the user is most likely holding, and the
 * 1,000th tells the product team who the power users are.
 *
 * The payload `where` does the filtering at the door: a user creating
 * their 57th document never enters. `concurrent`: each milestone is its
 * own journey and none waits for another. The count travels from the
 * event into the messages, so one template serves every milestone.
 */
export const milestoneCelebration = workflow({
  id: 'milestone_celebration',
  name: 'Milestone celebration',
  trigger: milestone,
  reentry: { mode: 'concurrent' },
})
  .timeWindow({ between: ['09:00', '21:00'] })
  // The newest device only: a celebration buzzing a tablet in a drawer
  // helps no one.
  .push(
    push.milestone,
    { count: milestone.payload.count },
    { devices: 'latest' }
  )
  .email(email.milestone, {
    name: u.name,
    count: milestone.payload.count,
  })
  .branch([
    eq(milestone.payload.count, 1000),
    (w) =>
      w.slack(slack.powerUser, {
        email: u.email,
        count: milestone.payload.count,
      }),
  ]);
Compiled canvasDrag to pan

When to use it

For products where usage accumulates into something users can be proud of: documents written, tasks closed, projects shipped. A milestone message acknowledges the work and costs nothing; the largest milestones point at the power users worth talking to.

How it works

  1. 1A doc_created event starts it only when its count is 10, 100 or 1,000 (the payload where).
  2. 2timeWindow holds until daytime.
  3. 3A push goes to the user’s most recently registered device only, then an email; both carry the count.
  4. 4A single-arm branch posts the 1,000th to the product team’s Slack.

Why it's built this way

Filter at the door

The payload where means the 57th document never starts a journey. No instance, no step, nothing in the numbers.

concurrent

Each milestone is its own short journey and none should wait for or block another, which after_exit could if two milestones came close together.

The newest device

{ devices: 'latest' } sends the push to one device, the one the user registered most recently, rather than every phone and tablet they ever used.

Make it yours

  • Use your product’s own unit and thresholds: inArray(p.count, [...]).
  • Add a milestone-specific gift, such as a template pack, through a custom action.
  • Post to your community Discord instead of a team Slack, if users opt in.

What to measure

Activity in the week after a milestone, compared with the week before.

Also see Slack alert for high-value sign-ups.