PushFyreAccelerate. Ignite. Broadcast.

Send an email notification from your own backend

8 min readPushFyre

Authenticate your sending domain once, then call POST /api/v1/push/send with channels set to email. Your backend supplies the subject and HTML. PushFyre sends it through Amazon SES from that domain and records opens, clicks, and unsubscribes.

Your system already has the email

A receipt, a shipping update, or a password reset is generated where the event happens. That service should send the email. The portal is where you prove the domain and store the sender. It does not have to be where every message is pasted.

PushFyre sends through Amazon SES from the domain you authenticate, signed with DKIM. Your backend stays in charge of the subject, the HTML, and the moment. The same app that sends push can send this email, with its own request.

What do you set up once, before the API can send?

Open Settings, then Email settings, then Senders, and add a sending domain. A subdomain such as mail.yourdomain.com keeps the reputation of that mail separate from your main site. Add the three DKIM CNAME records, and the recommended _dmarc TXT record, then verify DNS.

Set the sender name, the sender address on that domain, an optional reply-to, and the mailing address. The mailing address is added to the footer, which CAN-SPAM requires. After verification, every API send can use that sender. senderId picks a specific sender. Without it, the app default is used. The walkthrough is in the email guide.

How do you send an email from your own backend?

Use the same send endpoint as push, with channels set to ["email"]. Email is its own request. It does not share a call with push, WhatsApp, or an A/B test. payload.title and payload.message are still required. The inbox uses payload.email for the subject, the preheader, and the HTML.

The headers are the same three: x-app-id, x-tenant-id, and x-api-key. Store the key on the server. A 201 response means the campaign is queued.

Receipt, from your server
curl -X POST https://push.example.com/api/v1/push/send \
  -H "x-app-id: app_49e692ad" \
  -H "x-api-key: $PUSHFYRE_SERVER_KEY" \
  -H "x-tenant-id: <your-tenant-id>" \
  -H "Content-Type: application/json" \
  -d '{
    "appId": "app_49e692ad",
    "campaignName": "receipt-1042",
    "type": "simple",
    "channels": ["email"],
    "payload": {
      "title": "Your receipt",
      "message": "Order 1042 is paid.",
      "email": {
        "subject": "Receipt for order 1042",
        "preheader": "Paid in full",
        "html": "<h1>Thanks for your order</h1><p>Order 1042 is paid.</p><p><a href=\"https://shop.example.com/orders/1042\">View the receipt</a></p><p><a href=\"{{unsubscribe_url}}\">Unsubscribe</a></p>"
      }
    }
  }'

Who is allowed to receive it?

Only an address the person agreed to. The SDK does not show a consent dialog for you. After they agree, the app can call setEmail, or your server can call POST /api/v1/email/api/subscribers with the address and an optional external user id.

Omit segmentId to reach every subscribed address. Pass segmentId to limit the send, and excludeSegmentId to remove a second group. An address that unsubscribed or reported spam stays unsubscribed when it is added again. A portal user is the one who can resubscribe it. Segments work for email the same way they work for push.

Can the same email also be designed in the portal?

Yes. Messages, then Email, opens a canvas for a title, paragraph, image, button, and the other blocks, including your own HTML. Save as template keeps the design, and Test and preview sends it to one address. A backend that already renders HTML can skip the canvas and post that HTML on payload.email.html.

Results sit with the rest of the app's campaigns. Email allowances depend on the plan. The Free plan does not include email. The amounts for paid plans are on the pricing page.

Do it in four steps

  1. Step 1

    Authenticate the domain

    Add the sender and the DKIM records, then verify DNS. This is done once per sending domain.

  2. Step 2

    Collect consent

    Store an address only after the person agrees, from the SDK or from POST /email/api/subscribers.

  3. Step 3

    Call the send endpoint

    Post channels set to email, with the subject and HTML your system already built.

  4. Step 4

    Watch opens and clicks

    The campaign report shows delivery, opens from the tracking pixel, and clicks on http and https links.

Questions

Do I have to design the email in PushFyre?

Your backend can send the HTML. Authenticate the domain in the portal, then post that HTML on the API. The portal designer is there when a teammate wants to build a campaign by dragging blocks.

Can one API call send both push and email?

Email uses its own request, with channels set to email. Send the push in a separate call when the same event should also reach the app or the browser.

What if the person already unsubscribed?

They stay unsubscribed. Adding the address again does not opt them back in. A portal user can resubscribe that address.

Where does the message actually go out from?

Amazon SES, using the domain you authenticated and the DKIM signature from those DNS records. PushFyre manages that sending. You do not run your own mail server for these campaigns.

Keep reading

Put the next send on your server

Create the app, generate a server key, and call the same endpoint your backend already knows how to reach.