feat: per-account email signatures#847
Conversation
Implements floatpane#794 Adds signature support per account. Each account can have its own signature stored in signatures/<accountID>.txt, falling back to the global signature.txt. The Account struct also supports an inline signature field for config-based setup. Changes: - Account.Signature field for inline per-account signatures - LoadSignatureForAccount() with fallback chain: per-account file -> inline field -> global signature - SaveSignatureForAccount() for per-account signature editing - Composer loads the correct signature based on selected account
|
Hi @andrinoff , my apologies, I'm still trying to learn go and hence doing a lot of smaller things. Do u have a preferable feature in mind that i can take? |
|
oh, actually, this is valid, sorry, wanted to keep this one. i'd just prefer if already contributors worked on bigger issues, rather than small 3 line changes, those are meant to involve new people, you are free to pick up any issue, that you think will be at least a bit more complicated. You don't have to contribute a lot, you can start working on an issue, and then draft a PR, and keep making progress. No contributions are perfect, and I, personally, or my teammates will help you through it. Just refrain from working on super easy chore tasks! I will now reopen this PR! |
|
will do! |
andrinoff
left a comment
There was a problem hiding this comment.
Generally, a good PR,
Other than the comments, I will probably come up with a design for settings, and finish the PR tomorrow for me, if you don't beat me to it!
| } | ||
| if signature == "" { | ||
| // Remove the file to fall back to global | ||
| os.Remove(path) |
There was a problem hiding this comment.
you should handle this error, as the file may be not removed for some reason, other than it not existing (os.Remove returns nil, i believe, when the file does not exist)
Signed-off-by: drew <[email protected]>
Signed-off-by: drew <[email protected]>
|
/approve |
floatpanebot
left a comment
There was a problem hiding this comment.
Approved on behalf of @andrinoff via /approve command.
What?
Adds per-account signature support. Each account can have its own signature that overrides the global one.
Changes:
Account.Signaturefield for inline per-account signatures (in config)LoadSignatureForAccount()with 3-tier fallback: per-account file -> inline field -> global signatureSaveSignatureForAccount()to persist per-account signatures insignatures/<id>.txtWhy?
Fixes #794
Only a global signature was available. Users with work and personal accounts need different signatures. The fallback chain ensures backward compatibility: existing global signatures still work for accounts without a per-account override.
Testing
go build .— compiles cleango test ./tui/— all tests pass