aboutsummaryrefslogtreecommitdiffstats
path: root/templates/forward_as_body
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2024-02-11 16:58:13 +0100
committerRobin Jarry <robin@jarry.cc>2024-02-11 21:07:56 +0100
commit2dcc83efda3efd61dffc75324e434ef32d322b8f (patch)
tree0669343cc84c47d4f20fd1a8524b6ff1a9fa35bf /templates/forward_as_body
parent2187ea163e879556cb9fdb45657c96d99db8a6f0 (diff)
downloadaerc-2dcc83efda3efd61dffc75324e434ef32d322b8f.tar.gz
templates: use email address as fallback
If replying to mail or forwarding a mail that doesn't have a recipient name, the automatically generated header line will just have an empty value. Use the names template to extract either the name if available otherwise the mbox name. While at it, instead of just taking the first item of the list, join all items to avoid an index error if the list is empty. Signed-off-by: Michael Walle <michael@walle.cc> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'templates/forward_as_body')
-rw-r--r--templates/forward_as_body2
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/forward_as_body b/templates/forward_as_body
index 5155fab2..3b27db0d 100644
--- a/templates/forward_as_body
+++ b/templates/forward_as_body
@@ -1,6 +1,6 @@
X-Mailer: aerc {{version}}
-Forwarded message from {{(index .OriginalFrom 0).Name}} on {{dateFormat .OriginalDate "Mon Jan 2, 2006 at 3:04 PM"}}:
+Forwarded message from {{.OriginalFrom | names | join ", "}} on {{dateFormat .OriginalDate "Mon Jan 2, 2006 at 3:04 PM"}}:
{{.OriginalText}}
{{- with .Signature }}