From 60fa54814c5e09c19259f4b919555b7ccd937abf Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Tue, 24 Dec 2019 09:22:48 -0800 Subject: [PATCH] Correct display name details. --- scripts/send-supporter-emails-by-category.plx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/send-supporter-emails-by-category.plx b/scripts/send-supporter-emails-by-category.plx index 64a3ebd..f2d717c 100644 --- a/scripts/send-supporter-emails-by-category.plx +++ b/scripts/send-supporter-emails-by-category.plx @@ -163,10 +163,14 @@ foreach my $id (@supporterIds) { open(my $sendmailFH, "|-", '/usr/lib/sendmail', '-f', $FROM_ADDDRESS, '-oi', '-oem', '--', @emails); + binmode $sendmailFH, ":utf8"; + print $sendmailFH "To: $fullEmailLine\n"; foreach my $line (@{$groupLines{$group}}) { - s/FIXME_DISPLAYNAME/$displayName/g; - print $sendmailFH $line; + die "no displayname for this item" if not defined $displayName or $displayName =~ /^\s*$/; + my $thisLine = $line; # Note: This is needed, apparently $line is by reference? + $thisLine =~ s/FIXME_DISPLAYNAME/$displayName/g; + print $sendmailFH $thisLine; } close $sendmailFH; usleep(60000);