-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add to different signatures, one for text and one for html #160
Comments
The code in the README didn't work for me*, but I can share how I've set this up. My org-msg-signature defaults to some html wrapped in
Then I used the example code in the README to come up with the following:
First, I set a couple of local convenience variables for whether it's a reply email, whether it's a plain text email, and to hold a basic signature for plain text emails. Then there are a couple of nested This works for setting the signature of the message being edited. What doesn't seem to happen is for separate text and HTML signatures to be added to the relevant parts of the message if there are both HTML and text versions (at least it doesn't for me using mu4e with org-msg). I don't know if this is the expected behaviour, or a bug. A quick scan of the code suggests the signature is only inserted once, into the buffer for editing the message. It would be good to have both versions of the signature included in emails that send both text and HTML parts, so I'll look into this further. *because |
If you use (defun mu4e-extras-set-contexts ()
"Set `mu4e-contexts'."
(setq mu4e-contexts
`(,(make-mu4e-context
:name "Personal HTML"
:match-func #'mu4e-extras-msg-is-personal-and-html-p
:vars `((user-mail-address . ,(getenv "PERSONAL_GMAIL"))
(org-msg-signature . ,org-msg-extras-personal-html-signature)))
,(make-mu4e-context
:name "Personal plain text"
:match-func #'mu4e-extras-msg-is-personal-and-plain-text-p
:vars `((user-mail-address . ,(getenv "PERSONAL_GMAIL"))
(org-msg-signature . ,org-msg-extras-personal-plain-text-signature)))
,(make-mu4e-context
:name "Work HTML"
:match-func #'mu4e-extras-msg-is-work-and-html-p
:vars `((user-mail-address . ,(getenv "WORK_EMAIL"))
(org-msg-signature . ,org-msg-extras-work-html-signature)))
,(make-mu4e-context
:name "Work plain text"
:match-func #'mu4e-extras-msg-is-work-and-plain-text-p
:vars `((user-mail-address . ,(getenv "WORK_EMAIL"))
(org-msg-signature . ,org-msg-extras-work-plain-text-signature))))))
(defun org-msg-extras-msg-is-html-p ()
"Return t iff the current message is an HTML message."
(not (null (condition-case nil
(org-msg-mua-call 'article-htmlp)
(error nil)))))
The other relevant functions are defined here. |
I really like this project, as so I can send html emails, which is demanded by my company.
But what I miss, is a way to provide two signatures, one for text messages, and one for html messages,
which are just placed at the end.
I am not sure, if this is possible by the org-msg-get-alternatives oder org-msg-composition-parameters function.
I tried to use the sample provided in the README.org, but it seems, that this function can be used to manipulate the text, which will be converted to html later. What I would like to achieve, is to manipulate the text after the conversion to html, so I can inject
the full html signature with all formatting. For the text version I like to insert the signature as plain text, without any org-mode special #+ instructions, which looks not so nice in the text context.
Is there a way to achive this?
The text was updated successfully, but these errors were encountered: