JCR account creation notification icon
Module Id
jcr-account-creation-notification
Group Id
org.jahia.community
Updated
Requires Jahia
8.2.1.0
Author
Florent BOURASSE
Category
Tools and Utilities
Status
COMMUNITY info

JCR account creation notification group_work

security administration

Sends an email notification whenever a JCR user account (jnt:user) is created under /users. Uses the mail service already configured in Jahia, with fully customisable subject and body templates. Bulk imports are excluded — only interactive user creations trigger the notification.

Dependencies & Dependants

FAQ

Configuration

Go to Administration → Server settings → Configuration → JCR Account Creation Notification.

Field Description Default
Recipient Email address that receives the notification. Leave empty to use the Jahia mail service default. (Jahia default)
Sender From address used for the notification. Leave empty to use the Jahia mail service default. (Jahia default)
Subject Subject template. Supports {server} (hostname) token. [{server}] JCR account creation notification
Body HTML body template. Supports {username}{creator}{time} tokens. Editable with a rich-text editor. (HTML template)

Settings can also be managed via file or GraphQL — see the sections below.

File-based configuration

Create or edit org.jahia.modules.jcraccountcreationnotification.cfg in the Jahia configuration directory:

# Optional — leave commented to use the Jahia mail service default
#recipient=security@example.com
#sender=noreply@example.com

subject=[{server}] JCR account creation notification
body=<p>Hi,</p><p>Username: {username}<br>Created by: {creator}<br>Creation time: {time}</p><p>Regards,</p>

GraphQL API

All operations require the admin permission.

Query

query {
    jcrAccountCreationNotificationSettings {
        recipient   # String (null = Jahia default)
        sender      # String (null = Jahia default)
        subject
        body
    }
}

Mutation

mutation {
    jcrAccountCreationNotificationSaveSettings(
        recipient: "security@example.com"  # optional
        sender: "noreply@example.com"      # optional
        subject: "[{server}] New JCR account"
        body: "<p>User: {username} — created by {creator} at {time}</p>"
    )
}

Returns true on success, false on error. Passing null for recipient or sender resets them to the Jahia mail service default. Invalid email addresses are rejected.

How To Install

Requirements

  • Jahia 8.2.1.0 or later
  • graphql-dxm-provider module
  • richtext-ckeditor5 module
  • A mail server configured in Jahia (Administration → Server settings → Configuration → Mail server)

Installation

  • In Jahia, go to Administration → Server settings → System components → Modules
  • Upload the JAR jcr-account-creation-notification-X.X.X.jar
  • Check that the module is started

License

MIT License

Copyright (c) 2020 - present Florent BOURASSÉ

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.