From: Andrew Ruthven Date: Mon, 27 Jun 2022 09:36:47 +0000 (+1200) Subject: Make the email col configurable, and die if we can't find it X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01a72badb4e0d0b2ecb96c1e176f9f2d333f8aff;p=mail-merge.git Make the email col configurable, and die if we can't find it --- diff --git a/merge.pl b/merge.pl index 65695af..b2f518b 100755 --- a/merge.pl +++ b/merge.pl @@ -203,6 +203,10 @@ sub merge_message { my $cc = $tmplData->{'cc'}; my $reply_to = $tmplData->{'reply_to'}; my $email_address = $cols->{'email'} || $cols->{'email_address'}; + if (! defined $email_address && defined $tmplData->{'email_col'}) { + $email_address = $cols->{$tmplData->{'email_col'}}; + } + die "Unable to find email_address" unless defined $email_address; if ($send) { # If we're sending email, then send it, optionally with a BCC.