Customize your notification templates

In Notifyr - Notifications for Bitbucket templates are used to send notifications when specific actions occur.

These templates are based upon the Jtwig template language can be customized to fit your organization's needs. 

Available Templates

The following templates are available in Notifyr

TemplateDescription / Action
CommitUsed when code has changed via a push or the Bitbucket file editor.

Fork

Send when a repository has been forked
Branch CreatedUsed when a new branch is created within a repository
Tag CreatedUsed when a new tag is created within a repository
Pull Request CreatedSend when a new Pull Request is created
Pull Request MergedSend when a Pull Request has been merged into the branch or repository.

Editing a template

The edit a template:

  1. Go to Administration → Email Templates (under the Notifyr heading)
  2. Choose Edit for the template you want to edit
  3. An editor with syntax highlighting can be used to change your templates
  4. Click Save to save your changes.

Template variables and functions

There are several variables and functions available for you to use in your templates

Variables

VariableDescription
userThe ApplicationUser who has triggered the event. ie. Created a new Pull Request or Pushed changes.
Context: All
repositoryThe Repository that triggered the event. For Pull Requests use the pullRequest variable.
Context: All
showDiffA boolean (true/false) that indicates if the receiver of the notification wants a diff included.
Context: All
commitsA list of EmailCommits in, or affected by, the event. The list is limited to 20 commits.
Context: Commit, Pull Request merged
totalCommitsThe total number of commits in, or affected by, the event.
Context: Commit, Pull Request merged
pullRequestThe PullRequest thas been created or merged.
Context: Pull Request created, Pull Request merged
refThe Branch or Tag can be used to display which Tag has been created or to which Branch, code has been pushed.
Context: Commit, Branch created, Tag created, Pull Request created, Pull Request merged
latestCommitThe latest EmailCommit in the Branch or Tag. It can be used to add some context to a newly created Tag.
Context: Branch created, Tag created
targetRepoThe Repository just created by the fork.
Context: Repository fork

The Available functions are subclasses of BaseTemplateFunction and can be found in the documentation.