Platform CLI
Learn
Developer docs User guide Quickstart CLI and AI agents Blog
Company
Services About Contact Links Get started

Modifying the built-in email templates

Updated

Raytha sends nine system emails: welcome messages, password notices and one-time login codes. Each is an editable template. This page shows how to change their subject and wording, which variables you can use and how to undo a change.

Before you start

  • You need the Manage System Settings permission to see Email templates in the sidebar.
  • Raytha must be able to send email. If SMTP is not set up, the emails are never delivered, however good the template is. See Set up SMTP and email and Sending emails.
  • Email templates use Liquid, like page templates. Read How Liquid templates work in Raytha first if you have not seen it.

Edit an email template

  1. In the sidebar, under Design, click Email templates. The list has the columns Subject, Developer name and Updated.
  2. Click the subject of the template you want. Its developer name is shown under the title.
  3. In the Envelope card, change the Subject if you want to.
  4. In the Message body editor, change the HTML and Liquid. Open the side panel to see the variables this template can use, and click one to insert it.
  5. Click Save at the top of the page.

You should see the notice Email template saved, and a new entry appears in the Revisions panel. The edit applies to the next email sent.

What each template is for

Developer nameWhen it is sent
raytha_email_admin_welcomeYou create an administrator and leave Email them a welcome message with a temporary password ticked.
raytha_email_admin_passwordresetYou reset an administrator's password and tick Email the new password.
raytha_email_admin_passwordchangedSomeone changes their password using the change password form.
raytha_email_user_welcomeYou create a public user and tick Send welcome email.
raytha_email_user_passwordresetYou reset a public user's password and tick Email the new password.
raytha_email_user_passwordchangedPresent and editable, but the current source never sends it. The change password form uses the admin one above.
raytha_email_login_beginloginwithmagiclinkA visitor asks for a one-time login code.
raytha_email_login_beginforgotpasswordA visitor submits the forgot password form.
raytha_email_login_completedforgotpasswordA visitor finishes resetting their password.

Default subjects all start with [{{ CurrentOrganization.OrganizationName }}], followed by text such as "Website login code" or "Password recovery (link expires after 15 minutes)". The subject is rendered as Liquid too, so you can use variables in it.

Variables you can use

In every email, Target is the person receiving it. CurrentOrganization holds the site settings.

VariableAvailable in
Target.FirstName, Target.EmailAddressAll nine.
Target.NewPasswordThe welcome and password reset emails.
Target.LoginUrlThe welcome emails and "completed forgot password".
Target.LoginWithEmailAndPasswordIsEnabledThe welcome emails. It is false when the site does not allow password sign-in, so the template can leave the password out.
Target.IsNewlyCreatedUserThe administrator welcome email. It is false when an existing account was added as an administrator.
Target.ForgotPasswordCompleteUrlThe "begin forgot password" email: the reset link.
Target.Code, Target.MagicLinkExpiresInSecondsThe one-time login code email.
CurrentOrganization.OrganizationName, CurrentOrganization.WebsiteUrlAll nine.

The side panel is the reliable list. Use it rather than this table when in doubt.

An example: add a help line to the login code email

Open raytha_email_login_beginloginwithmagiclink and add a paragraph before the thank-you line:

<p>Need a hand? Reply to this email or visit
  <a href="{{ CurrentOrganization.WebsiteUrl }}/contact">our contact page</a>.</p>

Leave the {{ Target.Code }} line in place. Without it the email is useless.

Test your change

There is no "send test email" button. To test, trigger the email for an address you control:

  1. Make sure SMTP works; see Set up SMTP and email.
  2. Trigger the email. For the login code, open the site's login page in a private window and request a code. For the welcome and reset emails, create or reset a test account with the email checkbox ticked.
  3. Open the message and check the subject, the wording and any links.
  4. If nothing arrives, open Email log under Observability to see what Raytha recorded about the send.

Undo a change

Every save adds a snapshot of the previous version to the Revisions panel. Click Revert beside a revision to restore its subject, CC, BCC and body. Reverting also keeps the version you replaced as a new revision, so you can swap back. See Revisions and publishing.

Gotchas

  • CC and BCC do not work on the built-in emails. Raytha refuses CC and BCC on all nine "for security reasons". Leave both fields empty. In the current release, entering any address there is rejected with an "is not in a valid email format" message, even a valid one.
  • Do not remove the essential variable. A reset email without Target.NewPassword, or a code email without Target.Code, sends the person nothing they can use.
  • Edits are live immediately. There is no draft. Test on a quiet site, or copy the original body into a note before you start.
  • You cannot delete or add email templates. The list holds exactly the nine system templates.
  • Email clients ignore a lot of CSS. Keep the layout simple, and put styles inline on the element, as the default one-time code email does.
  • The subject is required. Saving with an empty subject or body is refused.

Next steps