1 from base import Setting, SettingSet
2 from django.utils.translation import ugettext_lazy as _
3 from django.forms.widgets import PasswordInput
4 from django.forms.widgets import RadioSelect
5 from forms import TestEmailSettingsWidget
7 EMAIL_SET = SettingSet('email', _('Email settings'), _("Email server and other email related settings."), 50)
9 TEST_EMAIL_SETTINGS = Setting('TEST_EMAIL_SETTINGS', '', EMAIL_SET, dict(
10 label = _("E-Mail settings test"),
11 help_text = _("Test the current E-Mail configuration."),
13 widget=TestEmailSettingsWidget))
15 EMAIL_HOST = Setting('EMAIL_HOST', '', EMAIL_SET, dict(
16 label = _("Email Server"),
17 help_text = _("The SMTP server through which your application will be sending emails."),
20 EMAIL_PORT = Setting('EMAIL_PORT', 25, EMAIL_SET, dict(
21 label = _("Email Port"),
22 help_text = _("The port on which your SMTP server is listening to. Usually this is 25, but can be something else."),
25 EMAIL_HOST_USER = Setting('EMAIL_HOST_USER', '', EMAIL_SET, dict(
26 label = _("Email User"),
27 help_text = _("The username for your SMTP connection."),
30 EMAIL_HOST_PASSWORD = Setting('EMAIL_HOST_PASSWORD', '', EMAIL_SET, dict(
31 label = _("Email Password"),
32 help_text = _("The password for your SMTP connection."),
34 widget=PasswordInput(render_value=True)))
36 EMAIL_USE_TLS = Setting('EMAIL_USE_TLS', False, EMAIL_SET, dict(
38 help_text = _("Whether to use TLS for authentication with your SMTP server."),
41 DEFAULT_FROM_EMAIL = Setting('DEFAULT_FROM_EMAIL', '', EMAIL_SET, dict(
42 label = _("Site 'from' Email Address"),
43 help_text = _("The address that will show up on the 'from' field on emails sent by your website."),
46 DEFAULT_REPLY_TO_EMAIL = Setting('DEFAULT_REPLY_TO_EMAIL', '', EMAIL_SET, dict(
47 label = _("Site 'reply-to' Email Address"),
48 help_text = _("The address that will show up on the 'reply-to' field on emails sent by your website."),
51 EMAIL_SUBJECT_PREFIX = Setting('EMAIL_SUBJECT_PREFIX', '', EMAIL_SET, dict(
52 label = _("Email Subject Prefix"),
53 help_text = _("Every email sent through your website will have the subject prefixed by this string. It's usually a good idea to have such a prefix so your users can easily set up a filter on their email clients."),
56 EMAIL_FOOTER_TEXT = Setting(u'EMAIL_FOOTER_TEXT', '', EMAIL_SET, dict(
57 label = _("Email Footer Text"),
58 help_text = _("Email footer text, usually \"CAN SPAM\" compliance, or the physical address of the organization running the website. See <a href=\"http://en.wikipedia.org/wiki/CAN-SPAM_Act_of_2003\">this Wikipedia article</a> for more info."),
61 EMAIL_BORDER_COLOR = Setting('EMAIL_BORDER_COLOR', '#e5ebf8', EMAIL_SET, dict(
62 label = _("Email Border Color"),
63 help_text = _("The outter border color of the email base template"),
66 EMAIL_PARAGRAPH_STYLE = Setting('EMAIL_PARAGRAPH_STYLE', "color:#333333;font-family:'helvetica neue', arial, Helvetica, sans-serif;line-height:18px;font-size:14px;margin-top:10px;", EMAIL_SET, dict(
67 label = _("Email Paragraph Style"),
68 help_text = _("A valid css string to be used to style email paragraphs (the P tag)."),
71 EMAIL_ANCHOR_STYLE = Setting('EMAIL_ANCHOR_STYLE', "text-decoration:none;color:#3060a8;font-weight:bold;", EMAIL_SET, dict(
72 label = _("Email Link Style"),
73 help_text = _("A valid css string to be used to style email links (the A tag)."),
76 SEND_DIGEST_ONLY_TO_ACTIVE_USERS = Setting('SEND_DIGEST_ONLY_TO_ACTIVE_USERS', True, EMAIL_SET, dict(
77 label = _("Send digest only to active users"),
78 help_text = _("If checked the daily digest won't be sent to users that have been suspended."),
81 SEND_DIGEST_ONLY_TO_VALIDATED_USERS = Setting('SEND_DIGEST_ONLY_TO_VALIDATED_USERS', True, EMAIL_SET, dict(
82 label = _("Send digest only to validated users"),
83 help_text = _("If checked the daily digest won't be sent to users that haven't validated their emails."),
86 EMAIL_DIGEST_FLAG = Setting('EMAIL_DIGEST_FLAG', None)