Ulabase

Build

Email

Your app sends email in two ways: the sign-up, password reset, invitation and Stripe emails go out on their own, and an email webhook sends the ones you set up. Each plan has a daily limit, and your own mail server lifts it.

Your service sends email for you: address verification, password reset, team invitations, order confirmations. It works with no setup.

Your app can send its own emails too, with an email webhook. You write a condition, for example a new document in orders, and every request that matches it sends an email.

This page tells you how many emails you can send on each plan, and who they come from: our address, or your own.

The Email page: today’s count against the daily limit

Out of the box

Emails come from noreply@ulabase.app, our address.

There is a daily limit:

Plan Emails a day About

Free

50

1,500 a month

Starter

500, or your own SMTP, not capped

15,000 a month

Pro

2,000, or your own SMTP, not capped

60,000 a month

Enterprise

Your own SMTP, not capped

The count resets at midnight UTC. The Email page shows how many you have sent today.

With your own mail server no limit applies: see below.

What leaves our address

From noreply@ulabase.app your service sends only our templates, with your name, color and logo, to people tied to it. The reason is simple: the address is ours, and whatever leaves it is written in our name.

Email From our address From your own mail server

Verification, password reset, invitation

Our template, to the users of your app

Your template

Stripe orders and subscriptions

Our template, to the buyer

Your template

Webhook email

Our words: the fields of the document that triggered it, as a table. Only to members of your organization and to users of your app who verified their address; the others are refused and the webhook’s log says which

Your subject, your template, any recipient

Every email from your own template closes with a short block you cannot remove: it says the email was sent by your app through Ulabase, that Ulabase did not write it, asks the reader to check the sender before following a link, and gives a way to report it to abuse@ulabase.com. Our templates carry the report line too.

In the console the Sign-up, Stripe and Webhooks pages show the template fields only when your own server is set up on the Email page.

Example: a contact form

A contact form on your site saves each message in the messages collection. An email webhook sends it to you.

First let visitors write to messages without signing in, with a permission:

{
  "_id": "visitorsCanSendMessages",
  "roles": ["$unauthenticated"],
  "predicate": "path('/messages') and method('POST')",
  "priority": 100
}

Then Console → your service → Webhooks → Add webhook, type Email:

{
  "id": "contact-form",
  "type": "email",
  "name": "Contact form",
  "condition": "path('/messages') and method('POST')",
  "email": {
    "to": ["you@yourshop.com"]
  }
}

From our address, you@yourshop.com must belong to a member of your organization, for example your own account. The email lists the fields of the message: name, address, text.

With your own mail server any address can receive it, and you write the subject and the body:

"email": {
  "to": ["info@yourshop.com"],
  "subject": "Message from {{request.body.name}}",
  "bodyType": "html",
  "htmlTemplate": "<p>{{request.body.name}} ({{request.body.email}}) wrote:</p><p>{{request.body.text}}</p>"
}

{{field}} writes what the visitor typed as text, so a message cannot add links or tags to the email.

Example: an email to the user

A signed-in user books a table: your app saves the booking in bookings, and the user gets an email.

The recipient comes from the document, so the permission writes the user’s own address in it with mergeRequest. Whatever the client sends in email is replaced:

{
  "_id": "usersCanBook",
  "roles": ["user"],
  "predicate": "path('/bookings') and method('POST')",
  "priority": 100,
  "mongo": {
    "mergeRequest": { "email": "@user.email" }
  }
}

The email webhook sends to that address:

{
  "id": "booking-confirmation",
  "type": "email",
  "name": "Booking confirmation",
  "condition": "path('/bookings') and method('POST')",
  "email": {
    "to": ["{{request.body.email}}"],
    "subject": "Your booking for {{request.body.date}}",
    "bodyType": "html",
    "htmlTemplate": "<p>Hello {{request.body.name}}, your table for {{request.body.guests}} is booked on {{request.body.date}}.</p>"
  }
}

To write the subject and the body yourself you need your own mail server, set up as in Send from your own address. From our address the email still leaves, with our words, and only if the user has verified their address.

Warning
Never take the recipient from a field the client writes freely. On a form anyone can submit, it would let anyone send email from your server to any address.

Send yourself a test

Check first that email works.

  1. Console → your service → Email

  2. Click Send test email

It goes to your account address, the same way a real one goes. If it fails, the page shows what the mail server said.

Tip
The test is a real email, so it counts against your daily allowance.

Send from your own address

Available from the Starter plan.

Your customers see orders@yourshop.com in place of noreply@ulabase.app, and our daily limit no longer applies: the sending reputation at stake is your own.

1. Set up DNS first

Warning
Do this first. If your domain has not authorised your mail server, delivery gets worse: mail that used to arrive starts going to spam.

You need two DNS records on your domain:

  • SPF: says your mail server may send for your domain.

  • DKIM: signs your messages so they cannot be forged.

Your mail provider gives you both. Add them, then wait for them to propagate.

2. Fill in the form

Console → your service → Email → Custom SMTP server.

Field Example

From address

orders@yourshop.com

From name

Your Shop

SMTP server

smtp.yourprovider.com

Port

465 for implicit TLS, 587 for STARTTLS

Username

usually the full address

Password

never shown again

Using Gmail

Gmail works with an app password; it refuses your account password.

  1. Turn on 2-Step Verification on your Google account, if it is not already on. App passwords need it.

  2. Go to myaccount.google.com/apppasswords and create one. Google shows it once: copy it now.

  3. Fill the form in with:

Field Value

From address

your Gmail address

SMTP server

smtp.gmail.com

Port

465, or 587 for STARTTLS

Username

your Gmail address, in full

Password

the app password

3. Test it

Click Send test email again. It now goes through your server.

If it fails, the page shows the mail server’s own message:

  • Connection refused: wrong host or port.

  • Authentication failed: wrong username or password.

  • Relay access denied: the server will not send for that From address.

Do it from the command line

The same settings, as configuration you keep in git, with ulabase:

import { defineSetup, step, fromEnv, isRedacted } from '@ulabase/cli';

const configured = (v: unknown) =>
  isRedacted(v) || (typeof v === 'string' && v.length > 0);

export default defineSetup('Mail', [
  step('mails feature installed', {
    check: ({ admin, srvId }) => admin.isFeatureInstalled(srvId, 'mails'),
    apply: ({ admin, srvId }) => admin.installFeature(srvId, 'mails'),
  }),

  step('sender configured', {
    async check({ admin, srvId }) {
      const c = await admin.getFeatureConfig(srvId, 'mails');
      return c['smtp-hostname'] === 'smtp.yourprovider.com'
          && configured(c['smtp-password']);
    },
    async apply({ admin, srvId }) {
      const current = await admin.getFeatureConfig(srvId, 'mails');
      await admin.updateFeatureConfig(srvId, 'mails', {
        ...current,
        'sender-email': 'orders@yourshop.com',
        'sender-name': 'Your Shop',
        'smtp-hostname': 'smtp.yourprovider.com',
        'smtp-port': 465,
        'smtp-username': 'orders@yourshop.com',
        'smtp-password': configured(current['smtp-password'])
          ? current['smtp-password']
          : fromEnv('SMTP_PASSWORD'),
      });
    },
  }),
]);

The service never returns the saved password: it sends •••••••• in its place. If you send •••••••• back, the service keeps the saved password. That is why the apply above sends current back unchanged.

When something goes wrong

No email arrives, and there is no error. Check today’s count on the Email page. When it runs out, sending stops until midnight UTC.

The port is ignored. Enter it as a number: 587 works, while older versions silently dropped "587" written as text.

Mail goes to spam after switching to your own server. Your SPF and DKIM records are missing or wrong. This is the most common problem, and you fix it in DNS.

A webhook stopped sending. Webhook emails count too. A webhook with several recipients takes them all from your allowance or none: five addresses with three left sends nothing.