Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • fusiondirectory-orchestrator fusiondirectory-orchestrator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 13
    • Issues 13
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • fusiondirectoryfusiondirectory
  • fusiondirectory-orchestratorfusiondirectory-orchestrator
  • Issues
  • #111
Closed
Open
Issue created Jun 18, 2025 by mluongo@mluongoReporter

Mail template body variables are not replaced with their actual values

Description

When a mail task sends a mail to a specific user based on a mail template I created, it does not replace the variables from the body content with their actual values.

Distribution Name and Version

debian:bullseye-slim

FusionDirectory Version

1.5-1

PHP version used

php7.4

Origin of php packages

apt-cache policy php7.4
php7.4:
  Installed: 7.4.33-1+deb11u8
  Candidate: 7.4.33-1+deb11u8
  Version table:
 *** 7.4.33-1+deb11u8 500
        500 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages
        100 /var/lib/dpkg/status
     7.4.33-1+deb11u5 500
        500 http://deb.debian.org/debian bullseye/main amd64 Packages

Steps to Reproduce

  1. Create a mail template with variables like $givenname or $givenName
  2. Create a mail task that uses the template for a specific user and schedule it
  3. run fusiondirectory-orchestrator-client --emails --verbose --debug
  4. check the email and the variables are not replaced

Expected behavior:

I expect $givenname or $givenName to be replaced with the actual name. I remember it was shown in FusionDirectory 1.5 livestream.

Actual behavior:

The mail I receive does not replace the variables with their actual values.

Additional Information

I have tested it for a specific user and this user has the LDAP attribute givenName :

cn doe
sn DOE
givenName John
uid doe
mail john.doe@company.com
gosaMailDeliveryMode []
... ...
objectClass inetOrgPerson
objectClass organizationalPerson
objectClass person
objectClass gosaMailAccount
objectClass companyPerson

I have tried other attributes as well like sn and uid. I have also tried surname and login as seen in examples.

here's my orchstrator config :

#Information related to LDAP
FD_LDAP_MASTER_URL="ldap://company.example.com:1389"
LDAP_BASE="dc=company,dc=example,dc=com"
LDAP_ADMIN="cn=admin,dc=company,dc=example,dc=com"
LDAP_PWD="pwd"

#Information related to the DSA login. Required by the fusiondirectory-orchestrator-client.
#Only DSA authentication is allowed
LDAP_OU_DSA="ou=dsa,dc=company,dc=example,dc=com"
DSA_LOGIN="fusiondirectory-orchestrator"
DSA_PASS="pwd"

#Information related to the webservice of FusionDirectory. Required to call FusionDirectory webservice.
FUSION_DIRECTORY_API_URL="https://company.example.com:81/rest.php/v1"
WEB_LOGIN="fd-admin"
WEB_PASS="pwd"

#Information related to the FusionDirectory Orchestrator Endpoint used by the client
ORCHESTRATOR_API_URL="http://company.example.com:81/orchestrator"

#Information related to Token management
#SECRET_KEY a 256 bit WEB keys required
SECRET_KEY="<256 bit web key>"
#INT representing seconds. Refresh = 5 days. Access = 5 minutes.
TOKEN_EXPIRY="300"
REFRESH_EXPIRY="432000"

#Information related to PHP Mailer
MAIL_AUTH="FALSE"
# If mail auth is TRUE, below user and pass are required
MAIL_USER="fusiondirectory"
MAIL_PASS="<mail_pass>"
MAIL_HOST="smtp.company.example.com"
MAIL_SEC_VERIFY="FALSE"
# If mail sec verify is set to true, mail_sec is required
MAIL_SEC="<ssl/tls>"
MAIL_PORT="25"

when I execute the task with debug, these are the only logs I get :

2025-06-18 11:59:30 {"access_token":"eyJ...9dU","refresh_token":"eyJ...vEc"}

2025-06-18 11:59:30 {
    "cn=first-login-SubTask-1750236042\\2C5914,ou=tasks,dc=company,dc=example,dc=com": {
        "statusUpdate": true,
        "mailStatus": "mail : cn=first-login-SubTask-1750236042\\2C5914,ou=tasks,dc=company,dc=example,dc=com was successfully sent",
        "updateLastMailExec": true
    }
}

here's my mail template definition :

cn=first-login,ou=mailTemplate
objectClass 	           fdMailTemplate
cn 	                   first-login
fdMailTemplateSubject 	   Your account
fdMailTemplateReadReceipt  TRUE
fdMailTemplateBody 	   $givenname $givenName $uid $login

Let me know if you need more information.

Assignee
Assign to
Time tracking