Skip to Content.
Sympa Menu

en - Re: [sympa-users] Message header/footer inheritance and variables?

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Adam Bernstein <address@concealed>
  • To: "Roger B.A. Klorese" <address@concealed>
  • Cc: address@concealed
  • Subject: Re: [sympa-users] Message header/footer inheritance and variables?
  • Date: Tue, 15 Apr 2008 14:14:17 -0700

Roger B.A. Klorese wrote:
Is it possible to define a message footer for an entire robot, and parameterize its content with replacement for the listname?

Not in stock Sympa, but I did this in an easy mod of my own to admin.pm, just requires adding one include line at the top and then a block of standard template parsing in the list creation module, with the diff against version 5.3.4 given below. Then just create your default message_footer.tt2 in the etc/mail.tt2 directory.

I think I submitted this patch a long time ago, but it was rejected as not being in line with Sympa design. But I could be confused about that.

ab


*** admin.pm Thu Jan 24 22:19:32 2008
--- admin-mod.pm Tue Apr 15 14:09:40 2008
***************
*** 43,48 ****
--- 43,52 ----

require "/home/sympa/bin/tools.pl";

+ #---begin customization:
+ # Needed for creation of default footer template in create_list_old():
+ require "/home/sympa/bin/tt2.pl";
+ #---end

=pod

***************
*** 218,224 ****
foreach my $o (@{$param->{'owner'}}){
&do_log('err',$o->{'email'});
}
! return undef;
}


--- 222,228 ----
foreach my $o (@{$param->{'owner'}}){
&do_log('err',$o->{'email'});
}
! return undef;
}


***************
*** 311,316 ****
--- 315,345 ----
print INFO $param->{'description'};
}
close INFO;
+ #---begin customization:
+ # Create default message footer:
+ unless (open FOOTER, '>:utf8', "$list_dir/message.footer") {
+ &do_log('err','Impossible to create %s/footer : %s',$list_dir,$!);
+ }
+
+ $param->{'robot'} = $robot;
+
+ my $parsed_output;
+ my $lang = &Language::GetLang();
+ my $tt2_include_path = [$list_dir.'/mail_tt2/'.$lang,
+ $list_dir.'/mail_tt2',
+ $Conf{'etc'}.'/'.$robot.'/mail_tt2/'.$lang,
+ $Conf{'etc'}.'/'.$robot.'/mail_tt2',
+ $Conf{'etc'}.'/mail_tt2/'.$lang,
+ $Conf{'etc'}.'/mail_tt2',
+ '/var/sympa/bin/etc'.'/mail_tt2/'.$lang,
+ '/var/sympa/bin/etc'.'/mail_tt2'];
+ &tt2::parse_tt2($param, 'message_footer.tt2', \$parsed_output, $tt2_include_path);
+
+ Encode::from_to($parsed_output, 'utf8', $Conf{'filesystem_encoding'});
+ print FOOTER $parsed_output;
+
+ close FOOTER;
+ #---end customization

## Create list object
my $list;




Archive powered by MHonArc 2.6.19+.

Top of Page