-
Notifications
You must be signed in to change notification settings - Fork 164
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
confirm send w/o attachment #395
Comments
I think you should have this multilingual. So a word list in most common languages could address more users. |
eventually i would also like to use gettext or so to internationalize all strings used in the ui. |
+1 for this feature sup saved me countless times from sending emails without attachments is there a way to use hooks right now for a similar functionality? |
Quoting josch (2013-02-15 07:18:23)
Well, you can use the But consider sending a pull request if you have the code, so we can add it as default feature.. |
I tried that using a ui.choice in the end which asks whether one really wants to send the email or not. Unfortunately it seems that ui.choice works asynchronously and the envelope_send is executed in the background anyways? How to prevent this? |
Quoting josch (2013-02-15 11:39:58)
ah yes: I'd have to investigate this further but it could be that The relevant code should be in ui.py, in |
also, with this a pre-command-hook can cancel the further execution of the command by raising an Exception. cf. issue #395
the linked commit fixes the issue with asynchronous post/pre hooks. with this you can implemented the "send w/o attachment?" feature as a hook e.g. like this:
|
The code you suggest doesn't work anymore:
|
yes, I think it's called body_plaintext and body_html now...
Quoting josch (2020-02-14 09:05:28)
… The code you suggest doesn't work anymore:
ERROR:ui:Traceback (most recent call last):
File "/usr/share/alot/alot/ui.py", line 272, in apply_commandline
await apply_this_command(c)
File "/usr/share/alot/alot/ui.py", line 713, in apply_command
await cmd.prehook(ui=self, dbm=self.dbman, cmd=cmd)
File "/home/josch/.config/alot/hooks.py", line 17, in pre_envelope_send
if re.match('.*[Aa]ttach', e.body, re.DOTALL) and\
AttributeError: 'Envelope' object has no attribute 'body'
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.*
|
Yes, |
Unless you are using the new txt2html feature, the html body should be None anyway. If you do, then it'd be a html-ized version of the plaintext. I'd just check the plaintext.
Quoting josch (2020-02-14 09:43:25)
… Yes, body_txt and body_html. I assume one now has to check both parts for this
kind of hook or is there a more convenient way?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.*
|
if keyword "attach" matches the body text.
this should be configurable.
the best solution that comes to mind is to put this into
envelope.SendCommand
and useui.choice
likeglobals.ExitCommand
does.The text was updated successfully, but these errors were encountered: