diff --git a/bin/account-manager.pl.in b/bin/account-manager.pl.in
index 793ebc4265586ca0ab843c625c7b0129a589d52b..db27ca1861f61a2641b3bad5ba48bf9d20ad2f42 100755
--- a/bin/account-manager.pl.in
+++ b/bin/account-manager.pl.in
@@ -348,6 +348,7 @@ sub send_notice {
     die "Failed to send mail notice to $options{email_address}\n"
         unless IdPAccountManager::Tools::mail_notice(
             template            => 'templates/mail/notification_generic_error.tt2.eml',
+            templates_dir       => $configuration->{templates_dir},
             data                => {},
             to                  => $options{email_address},
             logger              => $logger,
diff --git a/lib/IdPAccountManager/Tools.pm b/lib/IdPAccountManager/Tools.pm
index ff1c86b6a56344c303cb1d9e01ff3f3441ac0048..089b76e5483181e64278e06c3f995fcdc16f8103 100644
--- a/lib/IdPAccountManager/Tools.pm
+++ b/lib/IdPAccountManager/Tools.pm
@@ -153,7 +153,10 @@ sub mail_notice {
       . $args{notice_from}
       . " $notice_email";
 
-    my $tt2 = Template->new(FILTERS => { qencode => [ \qencode, 0 ] });
+    my $tt2 = Template->new({
+        FILTERS      => { qencode => [ \qencode, 0 ] },
+        INCLUDE_PATH => $args{templates_dir}
+    });
     unless ($tt2->process($tt2_file, $mail_data, \*SENDMAIL)) {
         $logger->errorf("Error TT2 : %s", $tt2->error());
     }
diff --git a/lib/IdPAccountManager/WebRequest.pm b/lib/IdPAccountManager/WebRequest.pm
index 333eca04588249bd100fab845556ee08c8e09b89..774b0d854570ce7d6255e2189fab37ecde58a248 100755
--- a/lib/IdPAccountManager/WebRequest.pm
+++ b/lib/IdPAccountManager/WebRequest.pm
@@ -187,6 +187,7 @@ sub respond {
         $self->{out}->{subject} = 'Error notification - web interface';
         IdPAccountManager::Tools::mail_notice(
             template            => 'mail/notification_generic_error.tt2.eml',
+            templates_dir       => $self->{configuration}->{templates_dir},
             data                => $self->{out},
             logger              => $self->{logger},
             conf                => $self->{configuration},