Skip to content
Snippets Groups Projects
Commit 89903f06 authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

pass templates directory to function

parent b8458ad6
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
......@@ -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());
}
......
......@@ -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},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment