aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-02-03 09:54:23 +0100
committerRobin Jarry <robin@jarry.cc>2022-02-03 09:55:20 +0100
commitdc6fd7c15e15fd1ec6a3b48a1367432a63bf4aaf (patch)
treed14282dab4a52f856ceb5a946bec8e51a3eb48de
parent77b3a141a4459a1e59583f0d9fee46e871466d74 (diff)
downloadaerc-dc6fd7c15e15fd1ec6a3b48a1367432a63bf4aaf.tar.gz
compose: allow setting all headers in templates
Allow setting To, Cc, Subject, Bcc in template headers. Fixes: https://todo.sr.ht/~rjarry/aerc/19 Signed-off-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--doc/aerc-templates.7.scd4
-rw-r--r--widgets/compose.go4
2 files changed, 6 insertions, 2 deletions
diff --git a/doc/aerc-templates.7.scd b/doc/aerc-templates.7.scd
index 9b17e289..0180a2d7 100644
--- a/doc/aerc-templates.7.scd
+++ b/doc/aerc-templates.7.scd
@@ -26,6 +26,10 @@ Chuck
If you have a template that doesn't add any header, it *must* be preceded by a
newline, to avoid parsing parts of the body as header text.
+All headers defined in the template will have precedence over any headers that
+are initialized by aerc (e.g. Subject, To, From, Cc) when composing a new
+message, forwarding or replying.
+
# MESSAGE DATA
The following data can be used in templates. Though they are not all
diff --git a/widgets/compose.go b/widgets/compose.go
index 1693314b..7229ec84 100644
--- a/widgets/compose.go
+++ b/widgets/compose.go
@@ -109,11 +109,11 @@ func NewComposer(aerc *Aerc, acct *AccountView, conf *config.AercConfig,
focused: 1,
completer: cmpl,
}
- c.buildComposeHeader(aerc, cmpl)
-
if err := c.AddTemplate(template, templateData); err != nil {
return nil, err
}
+ c.buildComposeHeader(aerc, cmpl)
+
c.AddSignature()
c.updateGrid()