Commit cc3ece3f1824617624e3d6eb52620758b0402b25
1 parent
524efcb7
Exists in
master
and in
5 other branches
Email Backend modal #210
Showing
1 changed file
with
25 additions
and
1 deletions
Show diff stats
app/models.py
1 | 1 | from django.db import models |
2 | - | |
2 | +from django.utils.translation import ugettext_lazy as _ | |
3 | 3 | # Create your models here. |
4 | + | |
5 | +class EmailBackend(models.Model): | |
6 | + | |
7 | + SAFE_CONECTIONS = ( | |
8 | + (0, _('No')), | |
9 | + (1, _('TLS, if available')), | |
10 | + (2, 'TLS'), | |
11 | + (3, 'SSL'), | |
12 | + | |
13 | + ) | |
14 | + description = models.CharField(_('Description'), max_length=100) | |
15 | + host = models.URLField(_('E-mail Host')) | |
16 | + port = models.CharField(_('Email Port'), max_length=4, blank=True) | |
17 | + username = models.CharField(_('Email host username'), max_length=30) | |
18 | + password = models.CharField(_('Email host password'), max_length=30, blank=True) | |
19 | + safe_conection = models.IntegerField(_('Use safe conection'), choices=SAFE_CONECTIONS, default=0) | |
20 | + default_from_email = models.EmailField(_('Default from email'), blank=True) | |
21 | + | |
22 | + class Meta: | |
23 | + verbose_name = _('Amadeus SMTP setting') | |
24 | + verbose_name_plural = _('Amadeus SMTP settings') | |
25 | + | |
26 | + def __str__(self): | |
27 | + return _('Custom email Backend') | ... | ... |