Creating and sending your first transactional email
DailyStory supports transactional email, the one-to-one messages your business sends in response to something a customer does, like a receipt, password reset, appointment confirmation or shipping update. In this tutorial, you'll design a transactional email in DailyStory and send it with the DailyStory API.
DailyStory supports two ways to send transactional email:
- Send the full email content to the API
- Use an email template and send personalization data to the API
For most businesses, and for this tutorial, option 2 is the simplest. You design the email once in DailyStory, then your app sends just the details that change, like an order number or confirmation link.
Use transactional email only for transactional messagesEmails marked as transactional bypass subscribers' opt-out preferences and DailyStory's normal sending guardrails, such as the check that prevents sending the same email to someone twice. Use them only for messages a customer needs because of an action they took, never for promotions or newsletters. See the Transactional Email Guide.
| Transactional email | Marketing email | |
|---|---|---|
| Triggered by | A specific customer action or account event | Your marketing calendar or automation |
| Examples | Receipts, password resets, booking confirmations, shipping updates | Newsletters, promotions, product announcements |
| Sent to opted-out contacts? | Yes, because the customer needs it | No |
| Main content | The information the customer is expecting | Offers and content to drive engagement |
Before you start
Step 1: Create your transactional email
You can create a transactional email by importing your own HTML, designing one with the drag-and-drop designer, starting from a built-in template, or using the API to create an email. We recommend a built-in template, since it's already mobile-friendly.
- Log in to DailyStory and create a new campaign, for example "Transactional Email Example."
- In the campaign, go to Assets, click + Add Asset, then click Add an Email.
- Select the Pre-built Email Templates tab, choose the Transactional category and pick a template.
- On the email settings screen, give the email a name, such as "Transactional Template." The email settings are detailed here.
Step 2: Insert personalization tokens
Personalization tokens are placeholders that DailyStory replaces with the values your app sends. Any key you include in the API request can be used in the subject, preheader or body as {{profile.your_key}}.
For example, an order confirmation might use these tokens:
| Where | Token | Example value |
|---|---|---|
| Subject | Your order {{profile.order_number}} is confirmed | Your order 10482 is confirmed |
| Body text | {{profile.order_summary}} | 2 items, total $48.50 |
| Button URL | {{profile.tracking_url}} | https://example.com/track/10482 |
| Button text | {{profile.button_text}} | Track your order |
- On the email settings screen, add tokens to the subject and preheader, then click Save Changes.
- Click Design Email and replace the template's sample content with your tokens, including the body text and the call-to-action button's text and URL.
- Click Save & Close. You can update the template any time.
Step 3: Mark the email as transactional and copy its ID
Open the email you created and expand its Advanced Options. Turn Is Transactional on, then copy the Email API ID. You'll use it in the API request.
Step 4: Get your site URL and API token
- Site URL: Go to Account Settings > Website and copy your site URL. It's unique to your account and looks like
https://us-1.dailystory.com/. - API token: Go to Account Settings > API Tokens and copy or create an API token. Keep it secret: anyone with the token can access your account through the API.
Step 5: Send the email with the API
Use the Send Email API to send your transactional email. Send a POST request to a URL like this:
- [email id]: the Email API ID from step 3
- [email address]: the recipient's email address. If they're not already a contact, DailyStory creates one.
Set the Authorization header to Bearer followed by your API token:
Then add a JSON body with the values for your tokens. You can also override the subject, preheader, from address or reply-to address for an individual send:
A successful request returns a response like this:
Check your inbox. You should see the email with your tokens replaced by the values you sent.
Transactional email best practices
- Send immediately. Customers expect receipts and password resets within seconds.
- Lead with the information they need, like the order number, appointment time or reset link, in the subject and at the top of the email.
- Keep branding consistent with your website and marketing emails so customers trust the message.
- Include one clear next step, such as tracking an order or managing a booking, and track clicks to see how customers use it.
- Keep promotions minimal. A small, relevant recommendation is fine, but the email's main purpose must stay transactional.
- Test before going live with a seed list or internal addresses, including what happens when a token value is missing.
Frequently asked questions
Do transactional emails need an unsubscribe link?
Purely transactional messages, like receipts and password resets, are generally exempt from CAN-SPAM's opt-out requirements. If an email mixes transactional and promotional content, its primary purpose determines how it's treated, so keep transactional emails focused.
Can I send to multiple recipients at once?
Yes. The email parameter accepts a comma-separated list of addresses, and the response returns a message ID for each successful send.
Can I attach a file, like a PDF receipt?
Yes. The Send Email API supports attachments. See the API reference for the format.
For more, see the DailyStory API documentation, explore our email features or see pricing.