Skip to Content.
Sympa Menu

en - RE: [sympa-users] Question Regarding Mail Merge Feature

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Steve Shipway <address@concealed>
  • To: "address@concealed" <address@concealed>
  • Cc: "address@concealed" <address@concealed>
  • Subject: RE: [sympa-users] Question Regarding Mail Merge Feature
  • Date: Tue, 6 May 2014 05:42:49 +0000

If you want to add new things to the Stash for mailmerge, the place to do it
is in the merge_msg() function in Bulk.pm.

The variable $data is a pointer to a hash that is passed to TT2 as the
stash. So, for example, if you do this:

$data->{list}{custom_var}{foo} = 1

Then in your mailmerge, you'll be able to have [% list.custom_var.foo %]

Of course, you'll probably want to properly populate the $data->{list} hash
with a few more things, as well, such as

my $list = new List($bulk->{listname},$bulk->{robot});
$data->{list}{name} = $bulk->{listname};
if (defined $list->{'admin'}{'custom_vars'}) {
$data->{list}{'custom_vars'} = {};
foreach my $var (@{$list->{'admin'}{'custom_vars'}}) {
$data->{list}{'custom_vars'}{$var->{'name'}} = $var->{'value'};
}
}

This is off of the top of my head though so you'd probably want to
experiment

Steve

Steve Shipway
address@concealed


Attachment: smime.p7s
Description: S/MIME cryptographic signature




Archive powered by MHonArc 2.6.19+.

Top of Page