Setup mailer app to use new Setting class
This commit is contained in:
@@ -17,3 +17,19 @@ class_permissions(Document, [
|
||||
PERMISSION_MAILING_LINK,
|
||||
PERMISSION_MAILING_SEND_DOCUMENT
|
||||
])
|
||||
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from smart_settings.api import register_settings, Setting, SettingNamespace
|
||||
|
||||
mailer_namespace = SettingNamespace('mailer', _(u'Mailer'))
|
||||
|
||||
Setting(
|
||||
namespace=mailer_namespace,
|
||||
module='mailer.conf.settings',
|
||||
name='LINK_SUBJECT_TEMPLATE',
|
||||
global_name='MAILER_LINK_SUBJECT_TEMPLATE',
|
||||
default='Link for document: {{ document }}',
|
||||
description=_(u'Template for the document link email form subject line.')
|
||||
)
|
||||
|
||||
@@ -2,17 +2,31 @@
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from smart_settings.api import register_settings
|
||||
from smart_settings.api import register_settings, Setting, SettingNamespace
|
||||
|
||||
register_settings(
|
||||
namespace=u'mailer',
|
||||
module=u'mailer.conf.settings',
|
||||
settings=[
|
||||
# Links
|
||||
{'name': u'LINK_SUBJECT_TEMPLATE', 'global_name': u'MAILER_LINK_SUBJECT_TEMPLATE', 'default': 'Link for document: {{ document }}', 'description': _(u'Template for the document link email form subject line.')},
|
||||
#{'name': u'LINK_SUBJECT_TEMPLATE', 'global_name': u'MAILER_LINK_SUBJECT_TEMPLATE', 'default': 'Link for document: {{ document }}', 'description': _(u'Template for the document link email form subject line.')},
|
||||
{'name': u'LINK_BODY_TEMPLATE', 'global_name': u'MAILER_LINK_BODY_TEMPLATE', 'default': 'To access this document click on the following link: <a href="{{ link }}">{{ link }}</a><br /><br />\n\n--------<br />\nThis email has been sent from Mayan EDMS (http://www.mayan-edms.com)', 'description': _(u'Template for the document link email form body line.')},
|
||||
# Attachment
|
||||
{'name': u'DOCUMENT_SUBJECT_TEMPLATE', 'global_name': u'MAILER_DOCUMENT_SUBJECT_TEMPLATE', 'default': 'Document: {{ document }}', 'description': _(u'Template for the document email form subject line.')},
|
||||
{'name': u'DOCUMENT_BODY_TEMPLATE', 'global_name': u'MAILER_DOCUMENT_BODY_TEMPLATE', 'default': 'Attached to this email is the document: {{ document }}<br /><br />\n\n--------<br />\nThis email has been sent from Mayan EDMS (http://www.mayan-edms.com)', 'description': _(u'Template for the document email form body line.')},
|
||||
]
|
||||
)
|
||||
|
||||
"""
|
||||
mailer_namespace = SettingNamespace('mailer', _(u'Mailer'))
|
||||
|
||||
Setting(
|
||||
namespace=mailer_namespace,
|
||||
module='mailer.conf.settings',
|
||||
name='LINK_SUBJECT_TEMPLATE',
|
||||
global_name='MAILER_LINK_SUBJECT_TEMPLATE',
|
||||
default='Link for document: {{ document }}',
|
||||
description=_(u'Template for the document link email form subject line.')
|
||||
)
|
||||
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user