Built-in emails
The seven emails the DMS sends: when each one goes out, its props, what it says, its language, its logo, and how to replace it.
Overview
The DMS sends seven emails of its own. Each one is a template registered through RegisterHtmlTemplate. The frontend server renders it from a Vue component in frontend-vue/layers/dms-layout/app/emails/, and the DMS delivers it through Send from @antelopejs/interface-email. The DMS sets no sender address, so every email goes out from the default sender of the email module your project loads.
| Template | Sent when | Sent to | English subject |
|---|---|---|---|
EmailUserValidation | With auth.mustValidateEmail on, a user who has not validated their email asks for a code, or an admin resends it from the Members page | The account's address | Verify Your Email |
EmailResetPassword | A user asks for a password reset | The account's address | Reset Your Password |
EmailTwoFactor | A user signs in with email as their second factor, adds email as a second-factor method, or asks for a new code | The account's address | Your verification code |
EmailAdminInvite | A member is invited to the platform or to a workspace | The invited address | See EmailAdminInvite |
EmailChangeVerification | A user asks to change their sign-in email | The new address | Confirm your new sign-in email |
EmailChangeNotice | The same request | The current address | Your sign-in email is being changed |
EmailExportReady | A data export delivered by email has finished | The user who asked for it | Your data export is ready |
An account created through an invitation link starts validated, so it receives no EmailUserValidation.
Each email, subject included, is written in the recipient's language, English or French. See Language.
Each email leaves with two alternatives: the rendered HTML and a plain-text reading of it. In the plain text, each block of the HTML is a paragraph and a link's address follows its label, so a mail client that shows no HTML still shows the code or the link. A template that replaces a built-in one gets its plain text the same way.
These names are taken. Give your own emails other names. To change what a built-in email looks like, see Replacing a built-in email.
Props
The backend passes these props to each template. A template that replaces a built-in one receives the same props.
| Template | Props |
|---|---|
EmailUserValidation | userName, validationCode, expiresInHours (from auth.emailValidationTokenLifetime), expiresIn |
EmailResetPassword | userName, resetCode, expiresInHours (from auth.passwordRecoverTokenLifetime), expiresIn |
EmailTwoFactor | userName, verificationCode |
EmailAdminInvite | email, signupLink, expiresInDays, and when known workspaceName, inviterName and platformName (meta.title) |
EmailChangeVerification | userName, newEmail, code, expiresInHours (from auth.emailValidationTokenLifetime), expiresIn |
EmailChangeNotice | userName, newEmail |
EmailExportReady | userName, downloadLink, expiresInHours, expiresIn, partial, failedSources (the export sources that could not be included) |
userName is the user's name, or their email address when they have none. expiresInHours is the lifetime as a number, for the template to word in the recipient's language. expiresIn is the same lifetime already worded in English (24 hours). It stays for templates written before expiresInHours existed.
What each email contains
Every built-in email uses the same frame, EmailLayout. A white card with rounded corners sits on a pale grey background. The card holds the logo when a mail client can load it (see Logo), a centered heading, the body text, a separator, and a footer in small, centered grey text. With the default SVG logo, the emails carry no logo.
A code sits in a grey box under the label Your verification code is:, in large monospaced characters. A link is a dark button with white text. An expiry line in small grey text follows the code or the button.
The English text of each email follows, with the props in angle brackets. A lifetime in hours reads 1 hour for one hour and N hours otherwise.
EmailUserValidation
- Heading:
Verify Your Email. - Body:
Hello <userName>,, thenThank you for signing up! Enter the verification code below to verify your email address:. - Code:
validationCode, six uppercase letters and digits. - Expiry:
This code expires in <expiresInHours>.The defaultauth.emailValidationTokenLifetimegives 24 hours. - Footer:
If you didn't create an account, you can safely ignore this email.
EmailResetPassword
- Heading:
Reset Your Password. - Body:
Hello <userName>,, thenWe received a request to reset your password. Enter the verification code below to reset your password:. - Code:
resetCode, six uppercase letters and digits, separate from the validation code. - Expiry:
This code expires in <expiresInHours>.The defaultauth.passwordRecoverTokenLifetimegives 24 hours. - Footer:
If you didn't request a password reset, you can safely ignore this email. Your password will remain unchanged.
EmailTwoFactor
- Heading:
Your verification code. - Body:
Hello <userName>,, thenUse this verification code to finish signing in:. - Code:
verificationCode, six digits. The email shows no expiry line. - Footer:
If you did not attempt to sign in, you can safely ignore this email.
EmailAdminInvite
The invitation names the inviter, the workspace and the platform when the backend knows them.
- Subject:
<inviterName> invited you to join <target>when the inviter is known,You're invited to join <target>otherwise, andYou're Invited to Joinwhen there is no target. The target is<workspaceName> on <platformName>when both are known, else whichever one is known. - Heading:
You're invited to <workspaceName>, orYou're Invited!without a workspace. - Body:
Hello,, then the invitation line andClick the button below to create your account:. The invitation line is<inviterName> invited you to join <target>.when the inviter is known,You've been invited to join <target>.otherwise, andYou've been invited to join our platform.when there is no target. - Button:
Create Account, which openssignupLink. - Expiry:
This invitation expires in <expiresInDays> days.The DMS sends 7 days. - Footer:
If you didn't expect this invitation, you can safely ignore this email.
EmailChangeVerification
The new address receives the code that confirms the change.
- Heading:
Confirm your new sign-in email. - Body:
Hello <userName>,, thenEnter the code below to make <newEmail> the sign-in email of your account:. - Code:
code, six digits. - Expiry:
This code expires in <expiresInHours>., fromauth.emailValidationTokenLifetime. - Footer:
If you didn't ask for this change, you can safely ignore this email: your account keeps its current address.
EmailChangeNotice
The current address receives a notice, not the confirmation code.
- Heading:
Your sign-in email is being changed. - Body:
Hello <userName>,, thenSomeone signed in to your account asked to change its sign-in email to <newEmail>. The change takes effect once that address is confirmed. - Footer:
If this wasn't you, change your password now and sign out the other sessions in Security: your account keeps this address until the new one is confirmed.
EmailExportReady
- Heading:
Your data export is ready. - Body:
Hello <userName>,, thenYour data export has been prepared. Use the button below to download the archive:. - Button:
Download export, which opensdownloadLink. - Expiry:
This download link expires in <expiresInHours>.An export link lasts 24 hours. - Partial export: when
partialis true, a further paragraph says the export is incomplete, listsfailedSourcesseparated by commas, and asks the recipient to request a new export if they need those parts. - Footer:
If you didn't request this export, you can safely ignore this email.
Language
Each email is written in the recipient's language. That is the account's language, or for an invitation the language the invitation was sent in. English and French are supported, and any other language falls back to English.
The body text lives in the dms-layout locale files (i18n/locales/layout-*.json). Each email has one key: emails.user_validation, emails.reset_password, emails.two_factor, emails.admin_invite, emails.email_change_verification, emails.email_change_notice and emails.export_ready. The shared texts sit under emails.common. Locale files merge in module priority order. A module registered with a priority above the DMS's (0) can reword any of these keys in its own i18n/locales/*.json:
{
"emails": {
"reset_password": {
"footer": "Didn't ask for this? Contact [email protected]."
}
}
}
The backend sets the subject, in the same language. A module cannot reword it.
Logo
Every built-in email draws branding.logo.email.light from the app config, or branding.logo.default.light when no email logo is set, with publicLogoOnly on. See Email layout for the rules. The logo shows only when a mail client can load it, which means an image other than SVG served from a public http or https address. The default DMS logo is an SVG, which Gmail and Outlook refuse, so by default the emails carry no logo. To show yours, set an email logo in your layer's app/app.config.ts, and serve the dashboard from a public clientBaseUrl:
export default defineDmsAppConfig({
branding: {
logo: {
email: {
light: "/branding/logo-email.png",
dark: "/branding/logo-email-dark.png",
},
},
},
});
The email renderer reads every layer's app/app.config.ts, merged in module priority order, so the config of a module registered with a priority above the DMS's (0) wins. dark is optional. When it passes the same rules and differs from light, the header becomes a <picture>. Mail clients that follow the reader's dark mode pick its dark source, and the others draw light.
Replacing a built-in email
The render server looks a template up by its file name, in module priority order, and renders the first match. A module registered with a priority above the DMS's (0, see AddFrontendModuleOptions) replaces a built-in email when its dms.email.ts ships a component of the same name:
export const serverEmailTemplates = import.meta.glob("./app/emails/**/*.vue");
<script setup lang="ts">
import { useI18n } from "vue-i18n";
import EmailLayout from "#dms-layout/app/emails/components/EmailLayout.vue";
import EmailOTP from "#dms-layout/app/emails/components/EmailOTP.vue";
defineProps<{ userName: string; resetCode: string; expiresInHours: number }>();
const { t, locale } = useI18n();
</script>
<template>
<EmailLayout :title="t('emails.reset_password.title')" :lang="locale" public-logo-only>
<EText>{{ t("emails.common.greeting", { name: userName }) }}</EText>
<EText>Use this code to choose a new Acme password:</EText>
<EmailOTP :code="resetCode" :expires-in="t('emails.common.hours', expiresInHours)" />
</EmailLayout>
</template>
The replacement receives the props listed in Props and keeps the backend's subject. Do not register the name again with RegisterHtmlTemplate, because the DMS already registers and sends it. At equal priority, the module whose id sorts first wins, so set the priority explicitly.