diff --git a/src/sa_api_v2/migrations/0007_auto_20180420_2012.py b/src/sa_api_v2/migrations/0007_auto_20180420_2012.py new file mode 100644 index 00000000..85a4c189 --- /dev/null +++ b/src/sa_api_v2/migrations/0007_auto_20180420_2012.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('sa_api_v2', '0006_attachment_type'), + ] + + operations = [ + migrations.RenameField( + model_name='placeemailtemplate', + old_name='bcc_email', + new_name='bcc_email_1', + ), + migrations.AddField( + model_name='placeemailtemplate', + name='bcc_email_2', + field=models.EmailField(default=None, max_length=75, blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='placeemailtemplate', + name='bcc_email_3', + field=models.EmailField(default=None, max_length=75, blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='placeemailtemplate', + name='bcc_email_4', + field=models.EmailField(default=None, max_length=75, blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='placeemailtemplate', + name='bcc_email_5', + field=models.EmailField(default=None, max_length=75, blank=True), + preserve_default=True, + ), + ] diff --git a/src/sa_api_v2/models/core.py b/src/sa_api_v2/models/core.py index 6643fcdc..547b9d9f 100644 --- a/src/sa_api_v2/models/core.py +++ b/src/sa_api_v2/models/core.py @@ -211,7 +211,11 @@ class PlaceEmailTemplate (TimeStampedModel): event = models.CharField(max_length=128, choices=EVENT_CHOICES, default='add') recipient_email_field = models.CharField(max_length=128) from_email = models.EmailField() - bcc_email = models.CharField(max_length=512, blank=True, default=None) + bcc_email_1 = models.EmailField(blank=True, default=None) + bcc_email_2 = models.EmailField(blank=True, default=None) + bcc_email_3 = models.EmailField(blank=True, default=None) + bcc_email_4 = models.EmailField(blank=True, default=None) + bcc_email_5 = models.EmailField(blank=True, default=None) subject = models.CharField(max_length=512) body_text = models.TextField() body_html = models.TextField(blank=True, default=None) diff --git a/src/sa_api_v2/views/base_views.py b/src/sa_api_v2/views/base_views.py index 4571b5b1..1d4cb32b 100644 --- a/src/sa_api_v2/views/base_views.py +++ b/src/sa_api_v2/views/base_views.py @@ -1231,7 +1231,11 @@ def trigger_emails(self, email_templates, obj): logger.info('[EMAIL] Starting email send') from_email = email_template.from_email - bcc_email = email_template.bcc_email + bcc_list =[email_template.bcc_email_1, + email_template.bcc_email_2, + email_template.bcc_email_3, + email_template.bcc_email_4, + email_template.bcc_email_5] logger.debug('[EMAIL] Got from email') @@ -1262,11 +1266,6 @@ def trigger_emails(self, email_templates, obj): logger.debug('[EMAIL] Going ahead, recipient exists') - # Set optional values - bcc_list = email_template.bcc_email.split(',') - - logger.debug('[EMAIL] Got bcc email') - # If we didn't find any errors, then render the email and send. context_data = RequestContext(self.request, { 'place': obj,