From b76bf1b7eecfc885798385960b04b92cb62d75f0 Mon Sep 17 00:00:00 2001 From: Bence Ferdinandy Date: Thu, 4 Jan 2024 21:02:19 +0100 Subject: templates: move signature from compose to templates Currently, when composing a new message, everything is read from the template files, except the signature, which is added directly in the compose code. Add a new template variable {{.Signature}}, by moving the logic of reading signature from command or file from compose to templates. Update the various default template files to preserve the original placement of signatures. Users using the default templates should not notice the change. Users with custom compose templates will need to update their templates with {{.Signature}}. Changelog-changed: Signature placement is now controlled via the `{{.Signature}}` template variable and not hardcoded. Signed-off-by: Bence Ferdinandy Acked-by: Robin Jarry --- templates/forward_as_body | 2 ++ templates/new_message | 2 ++ templates/quoted_reply | 2 ++ 3 files changed, 6 insertions(+) (limited to 'templates') diff --git a/templates/forward_as_body b/templates/forward_as_body index 564f6ed5..b29c3976 100644 --- a/templates/forward_as_body +++ b/templates/forward_as_body @@ -2,3 +2,5 @@ X-Mailer: aerc {{version}} Forwarded message from {{(index .OriginalFrom 0).Name}} on {{dateFormat .OriginalDate "Mon Jan 2, 2006 at 3:04 PM"}}: {{.OriginalText}} + +{{.Signature}} diff --git a/templates/new_message b/templates/new_message index f6b3d02a..34f80bc0 100644 --- a/templates/new_message +++ b/templates/new_message @@ -1 +1,3 @@ X-Mailer: aerc {{version}} + +{{.Signature}} diff --git a/templates/quoted_reply b/templates/quoted_reply index 95162172..147a4fa5 100644 --- a/templates/quoted_reply +++ b/templates/quoted_reply @@ -2,3 +2,5 @@ X-Mailer: aerc {{version}} On {{dateFormat (.OriginalDate | toLocal) "Mon Jan 2, 2006 at 3:04 PM MST"}}, {{(index .OriginalFrom 0).Name}} wrote: {{trimSignature .OriginalText | quote}} + +{{.Signature}} -- cgit