Onboarding

App download link SMS: template and code

Move web signups onto your mobile app with a text, then an email, and skip anyone who already installed.

Passing, tested 2026-10-19 · SMS, Email

How it works

When to send an app download link

An app download link SMS gets web signups onto your mobile app. Two days after signup it texts a link to your app, and on day 5 it emails App Store and Google Play buttons. People without a phone number get only the email, and installing the app stops the rest.

  1. Web signup
    Your app starts the journey
  2. Day 2
    SMS with the download link
    Skipped if there's no phone number. Canceled once the app is installed
  3. Day 5
    Email with App Store and Google Play buttons
    Canceled once the app is installed

Stops early: When the app is installed, cancel the run and every step still to come is dropped. Cancel it the same way when the account is deleted.

The waits are Courier delay nodes. We test this exact journey with each wait shortened to seconds.

Messages

What each step sends

Step 1: 2 days after signup

SMS with the download link. Skipped if there's no phone number. Canceled once the app is installed.

SMS

Acme: get our app for iPhone and Android here: https://acme.app/get Reply STOP to opt out.

Step 2: 5 days after signup

Email with App Store and Google Play buttons. Canceled once the app is installed.

Email

From: Acme
Get the Acme app

Hi Dana,

Acme also comes as a mobile app. Download it and sign in with the account you already have.

Download on the App StoreGet it on Google Play

Other subject lines: "Get Acme on your phone"

Want different timing? Change the 2-day and 3-day waits in the Journeys editor. The second wait counts from the first, so the email goes 3 days after the text.

Build

Add it to your app

1. Create the journey

Run setup.ts once with your API key. It creates the templates and the journey, publishes it, and prints the journey ID you pass to step 2. Copy setup.ts, journey.json, and the templates folder from the full definition at the end of this section.

Terminal

COURIER_API_KEY=pk_... node --experimental-strip-types setup.ts

2. Start it when someone signs up

Node.js

// Start the sequence when someone signs up on the web, with the journey ID setup.ts printed.
// The templates read the first name from the user's Courier profile, so
// there's no data to pass.
import Courier from "@trycourier/courier";
const client = new Courier();
export async function startAppDownloadLinks(journeyId: string, userId: string) {
const { runId } = await client.journeys.invoke(journeyId, {
user_id: userId,
});
return runId;
}

Python

# Start the sequence when someone signs up on the web, with the journey ID setup.ts printed.
# The templates read the first name from the user's Courier profile, so
# there's no data to pass.
from courier import Courier
client = Courier()
def start_app_download_links(journey_id: str, user_id: str) -> str:
response = client.journeys.invoke(template_id=journey_id, user_id=user_id)
return response.run_id

3. Stop it when they install the app

Node.js

// Stop the sequence when the app is installed, or when the account is deleted.
// It cancels every run waiting for the user, and does nothing if the sequence
// already finished.
import Courier from "@trycourier/courier";
const client = new Courier();
export async function stopAppDownloadLinks(userId: string) {
await client.journeys.cancel({ cancelation_token: `app-${userId}` });
}

Python

# Stop the sequence when the app is installed, or when the account is deleted.
# It cancels every run waiting for the user, and does nothing if the sequence
# already finished.
from courier import Courier
client = Courier()
def stop_app_download_links(user_id: str) -> None:
client.journeys.cancel(cancelation_token=f"app-{user_id}")
Full definition: journey.json, setup.ts, and the 2 templates

The SMS goes on day 2 to anyone with a phone number, and the email goes on day 5 to everyone.

When someone signs in on mobile, your app cancels the run and nothing else goes out.

journey.json

{
"name": "App download link",
"cancelation_token": "app-{{recipient}}",
"nodes": [
{
"type": "trigger",
"trigger_type": "api-invoke"
},
{
"type": "delay",
"mode": "duration",
"duration": "P2D"
},
{
"type": "send",
"channel": "sms",
"message": {
"template": "@app-link-sms"
},
"conditions": ["profile.phone_number", "exists"]
},
{
"type": "delay",
"mode": "duration",
"duration": "P3D"
},
{
"type": "send",
"channel": "email",
"message": {
"template": "@app-link-email"
}
},
{
"type": "exit"
}
]
}

setup.ts

// Creates this recipe's journey from journey.json and the templates/ folder,
// then publishes it. Run it once per workspace:
//
// COURIER_API_KEY=pk_... node --experimental-strip-types setup.ts
//
// It prints the journey ID and the template IDs it created.
import Courier from "@trycourier/courier";
import { readFileSync, readdirSync } from "node:fs";
const client = new Courier();
const here = new URL(".", import.meta.url);
const readJson = (path: string) =>
JSON.parse(readFileSync(new URL(path, here), "utf8"));
const spec = readJson("journey.json");
// 1. Create the journey, then the templates its send nodes use.
const journey = await client.journeys.create({
name: spec.name,
nodes: [spec.nodes[0], spec.nodes.at(-1)],
});
const templateIds: Record<string, string> = {};
for (const file of readdirSync(new URL("templates/", here))) {
const key = file.replace(/\.json$/, "");
const template = await client.journeys.templates.create(
journey.id,
readJson(`templates/${file}`)
);
await client.journeys.templates.publish(template.id, {
templateId: journey.id,
});
templateIds[key] = template.id;
}
// 2. Save the nodes. In journey.json, "@<template>" stands for the ID of the
// template with that file name. Node IDs must be unique across a workspace,
// so any node ID journey.json names (used by "send_status.<id>" conditions)
// gets this journey's ID added.
const nodeIds = [
...JSON.stringify(spec.nodes).matchAll(/"id":"([\w-]+)"/g),
].map((m) => m[1]);
let nodes = JSON.stringify(spec.nodes).replace(/"@([\w-]+)"/g, (_, key) =>
JSON.stringify(templateIds[key])
);
for (const id of nodeIds)
nodes = nodes.replace(
new RegExp(`(?<=[".])${id}(?=")`, "g"),
`${id}-${journey.id}`
);
await client.journeys.replace(journey.id, {
name: spec.name,
cancelation_token: spec.cancelation_token,
nodes: JSON.parse(nodes),
});
// 3. Publish, so new runs use this version.
await client.journeys.publish(journey.id);
console.log(JSON.stringify({ journeyId: journey.id, templateIds }));

templates/app-link-sms.json

templates/app-link-email.json

Agents

Hand it to your agent

Give this prompt to Claude Code, Cursor, or Codex with the Courier skill installed. Agents can also read the markdown version and the manifest.

Add an app download link sequence to this app, sent through Courier: an SMS with the download link 2 days after a web signup, then an email with App Store and Google Play buttons on day 5, both skipped once the user installs the app. Follow the steps at https://www.courier.com/recipes/app-download-link-sms.md and use the Courier skill for SDK details. 1. Create the journey and its templates in my Courier workspace by replacing Acme and the download links in the template files with our own, then running setup.ts from that page with COURIER_API_KEY from our environment. Save the journey ID it prints as COURIER_APP_LINK_JOURNEY_ID. 2. Find where this codebase creates a new web user and start the journey there. Pass only the user ID, and make sure first_name and phone_number are written to their Courier profile at signup. 3. Find where a user first signs in on the mobile app and cancel the journey there with the token app-<user_id>. Cancel it the same way when an account is deleted. 4. Match this codebase's language, file layout, and error handling. Never hardcode the API key. 5. When you're done, start one run for a test user and show me the run's steps.

Data

Data fields

FieldTypeExampleNote
profile.first_namestringDanaFrom the profile. Write it when the user signs up. The emails say "there" when it's missing

FAQ

Frequently asked questions

When should I send an app download link after signup?

Give the web product a couple of days first, then text. This recipe texts on day 2 and emails on day 5, and you can change either wait in the Journeys editor.

How do I skip people who already installed the app?

When the app first signs in, cancel the run with the token app-<user_id>. Nothing is stored on the profile, and the SMS and email still to come are dropped.

What happens if the user has no phone number?

The SMS is skipped and the email still goes. The SMS step checks the profile for a phone number first.

Can one link work for both iPhone and Android?

Yes. Use a link from your deep link or attribution provider that routes by device as the SMS link. The email has a separate button for each store.

Build this in your workspace

Run setup.ts against a free account and the journey is live in a minute. Prefer no code? Rebuild it in the Journeys editor.