Exemple #1
0
def _send_email(form_data, template):
    # The form_data param should be an instance of form.cleaned_data
    message_body = render_to_string(template, form_data)

    try:
        send_mail(
            form_data['subject'],
            message_body,
            form_data['sender'],
            get_admin_email_addresses()
        )
    except Exception as e:
        print e
Exemple #2
0
 def test_get_admin_email_addresses_returns_email_addresses(self):
     emails = get_admin_email_addresses()
     self.assertIn('*****@*****.**', enumerate(emails).next())
     self.assertIn('*****@*****.**', enumerate(emails).next())
Exemple #3
0
 def test_get_admin_email_addresses_returns_correct_number_of_email_addresses(self):
     self.assertEquals(2, len(list(get_admin_email_addresses())))