Auto-disable button when sending email preview

This commit is contained in:
Lance Edgar 2018-10-05 19:58:58 -05:00
parent 29e023096b
commit f17d7355e0
2 changed files with 4 additions and 5 deletions

View file

@ -280,9 +280,7 @@ class EmailPreview(View):
def email_template(self):
recipient = self.request.POST.get('recipient')
if recipient:
keys = [key for key in self.request.POST.keys()
if key.startswith('send_')]
key = keys[0][5:] if keys else None
key = self.request.POST.get('email_key')
if key:
email = mail.get_email(self.rattail_config, key)
data = email.sample_data(self.request)