Allow the use of template parameters for email subjects.

This commit is contained in:
John Schember 2011-03-30 07:18:13 -04:00
parent 186e3e9689
commit 7d7b7bd2be
2 changed files with 8 additions and 1 deletions

View File

@ -22,6 +22,7 @@ from calibre.customize.ui import available_input_formats, available_output_forma
from calibre.ebooks.metadata import authors_to_string
from calibre.constants import preferred_encoding
from calibre.gui2 import config, Dispatcher, warning_dialog
from calibre.library.save_to_disk import get_components
from calibre.utils.config import tweaks
class EmailJob(BaseJob): # {{{
@ -242,6 +243,10 @@ class EmailMixin(object): # {{{
if not subject:
subjects.append(_('E-book:')+ ' '+t)
else:
components = get_components(subject, mi, id)
if not components:
components = [mi.title]
subject = os.path.join(*components)
subjects.append(subject)
a = authors_to_string(mi.authors if mi.authors else \
[_('Unknown')])

View File

@ -29,7 +29,9 @@ class EmailAccounts(QAbstractTableModel): # {{{
self.tooltips =[NONE] + map(QVariant,
[_('Formats to email. The first matching format will be sent.'),
_('Subject of the email to use when sending. When left blank '
'the title will be used for the subject.'),
'the title will be used for the subject. Also, the same '
'templates used for "Save to disk" such as {title} and '
'{author_sort} can be used here.'),
'<p>'+_('If checked, downloaded news will be automatically '
'mailed <br>to this email address '
'(provided it is in one of the listed formats).')])