Skip to main content

Configure Mail Templates

Mail Templates define the subject and body of email notifications sent by the system for specific events such as user registration, password resets, build status changes, and system-level actions. These templates are used by the Notifier service to generate the final email content delivered to users.

BuildNinja allows you to configure these mail templates. You can:

  • Customize email messaging to match organizational communication standards.
  • Add or modify dynamic content using supported template variablesMail Templates support dynamic variables that are replaced with runtime values when the email is generated. Variables are template-scope specific and can be used only with the events they support..
  • Create different templates for build-related notifications when required.

Mail Templates are event-driven and are selected automatically based on the event that occurs. For build-related events, the selected template is determined by the Notification SettingsBuildNinja enables you to configure Notification Settings at the build configuration level. These settings define how and when you receive alerts for your builds. of the corresponding build configuration.

Mail Template Types

Mail Templates are grouped by the type of system event that triggers them. Each group is identified by a fixed template scope.

User and Account Templates

User and account templates are triggered by user lifecycle and account-related events. They are system-level templates and cannot be created or deleted.

Template ScopeDescription
SignupSent when a new user registers in the system.
Signup SSOSent when a new user signs up or logs in for the first time using Single Sign-On (SSO).
User AddedSent when an administrator adds a new user.
User BlockedSent when a user account is blocked.
User ApprovedSent when a user registration request is approved.
User RejectedSent when a user registration request is rejected.
Forgot PasswordSent when a user requests a password reset.
Password ResetSent after a user password is successfully reset.

Build and CI Templates

Build and CI templates are triggered by build execution events. Multiple custom templates can be created for these event types.

Template ScopeDescription
Build FailureSent when a build fails.
Build SuccessSent when a build passes successfully.
Build CompletedSent when a build completes, regardless of status.

System and Agent Templates

System and agent templates are related to system health and configuration testing.

Template ScopeDescription
Agent DisconnectedSent when a build agent disconnects.
Test SMTPUsed only to test SMTP configuration and email delivery. This template is triggered only from the notifier test action and is not associated with any system or build event.

Template Fields

Each mail template contains the following fields:

FieldDescription
ScopeEvent type that triggers the template.
NameDisplay name of the template shown in the UI.
SubjectEmail subject line. Plain text and variables are allowed.
BodyEmail body in HTML format. Variables are allowed.

mail-templates-add-new-template-pop-up-fields

note

The Content field must contain valid HTML. Plain-text email bodies are not supported.

Create New Build Mail Template

  1. Navigate to Settings settings-icon and open Mail Templates.

    mail-templates-tab

  2. Click Add New Template.

    mail-templates-add-new-template-button

  3. In the Add New Template pop-up, provide the following details:

    • Scope: Select one of the supported build-related scopes.
    • Name: Display name for the template.
    • Subject: Subject line of the email. Variables are allowed.
    • Body: HTML body of the email. Variables are allowed.

    mail-templates-add-new-template-pop-up

  4. Click Save to create the template.

    mail-templates-add-new-template-pop-up-save-button

Edit Mail Template

  1. Select the required template from the list and click the Ellipsis ⋮ to open the options menu.

    mail-templates-template-options-menu

  2. Click Edit.

    mail-templates-template-edit-button

  3. Make the required changes, and then click Save to apply them.

    mail-templates-template-save-button

Reset Mail Template to Default

Reset restores the template to the default version for the currently installed application release. After a reset, future application upgrades may automatically update the template.

  1. Select the required template from the list and click the Ellipsis to open the options menu.

    mail-templates-template-reset-options-menu

  2. Click Reset. The template will reset to the default version for the currently installed application release.

    mail-templates-template-reset-button

note

Custom build templates cannot be reset.

Delete Build Mail Template

Delete removes the selected custom build mail template that is no longer required. System default templates cannot be deleted.

  1. Select the required template from the list and click the Ellipsis to open the options menu.

    mail-templates-template-options-menu

  2. Click Delete.

    mail-templates-template-delete-button-custom-template

warning

If a deleted template is still assigned to a build configuration, email delivery will fail for that event. Ensure the template is removed from all build notification settings before deleting it.