Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
cc theme review email on theme reviews (bug 856154)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngokevin committed Apr 4, 2013
1 parent d925092 commit fdca097
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
8 changes: 6 additions & 2 deletions mkt/reviewers/tasks.py
Expand Up @@ -30,6 +30,7 @@ def send_mail(cleaned_data, theme_lock):
comment = cleaned_data['comment']

emails = set(theme.addon.authors.values_list('email', flat=True))
cc = settings.THEMES_EMAIL
context = {
'theme': theme,
'base_url': settings.SITE_URL,
Expand All @@ -56,7 +57,6 @@ def send_mail(cleaned_data, theme_lock):
elif action == rvw.ACTION_FLAG:
subject = _('Theme submission flagged for review')
template = 'reviewers/themes/emails/flag_reviewer.html'
emails = [settings.THEMES_EMAIL]
theme.addon.update(status=amo.STATUS_REVIEW_PENDING)

# Send another email to the user notifying them that their Theme has
Expand All @@ -66,6 +66,10 @@ def send_mail(cleaned_data, theme_lock):
recipient_list=emails,
headers={'Reply-To': settings.THEMES_EMAIL})

# Send the other email below to themes email.
emails = [settings.THEMES_EMAIL]
cc = None

elif action == rvw.ACTION_MOREINFO:
subject = _('A question about your Theme submission')
template = 'reviewers/themes/emails/moreinfo.html'
Expand All @@ -82,5 +86,5 @@ def send_mail(cleaned_data, theme_lock):
theme.save()

send_mail_jinja(subject, template, context,
recipient_list=emails,
recipient_list=emails, cc=cc,
headers={'Reply-To': settings.THEMES_EMAIL})
12 changes: 6 additions & 6 deletions mkt/reviewers/tests/test_views.py
Expand Up @@ -2117,47 +2117,47 @@ def test_commit(self, send_mail_jinja_mock):
'reviewer_email': u'reviewer0@mozilla.com',
'base_url': 'http://testserver'},
headers={'Reply-To': settings.THEMES_EMAIL},
recipient_list=set([])),
recipient_list=set([]), cc=settings.THEMES_EMAIL),
mock.call('A problem with your Theme submission',
'reviewers/themes/emails/flag_user.html',
{'reason': None,
'comment': u'flag',
'theme': themes[1],
'base_url': 'http://testserver'},
headers={'Reply-To': settings.THEMES_EMAIL},
recipient_list=[settings.THEMES_EMAIL]),
recipient_list=set([])),
mock.call('Theme submission flagged for review',
'reviewers/themes/emails/flag_reviewer.html',
{'reason': None,
'comment': u'flag',
'theme': themes[1],
'base_url': 'http://testserver'},
headers={'Reply-To': settings.THEMES_EMAIL},
recipient_list=[settings.THEMES_EMAIL]),
recipient_list=[settings.THEMES_EMAIL], cc=None),
mock.call('A problem with your Theme submission',
'reviewers/themes/emails/reject.html',
{'reason': mock.ANY,
'comment': u'duplicate',
'theme': themes[2],
'base_url': 'http://testserver'},
headers={'Reply-To': settings.THEMES_EMAIL},
recipient_list=set([])),
recipient_list=set([]), cc=settings.THEMES_EMAIL),
mock.call('A problem with your Theme submission',
'reviewers/themes/emails/reject.html',
{'reason': mock.ANY,
'comment': u'reject',
'theme': themes[3],
'base_url': 'http://testserver'},
headers={'Reply-To': settings.THEMES_EMAIL},
recipient_list=set([])),
recipient_list=set([]), cc=settings.THEMES_EMAIL),
mock.call('Thanks for submitting your Theme',
'reviewers/themes/emails/approve.html',
{'reason': None,
'comment': u'',
'theme': themes[4],
'base_url': 'http://testserver'},
headers={'Reply-To': settings.THEMES_EMAIL},
recipient_list=set([]))
recipient_list=set([]), cc=settings.THEMES_EMAIL)
]
eq_(send_mail_jinja_mock.call_args_list[0], expected_calls[0])
eq_(send_mail_jinja_mock.call_args_list[1], expected_calls[1])
Expand Down

0 comments on commit fdca097

Please sign in to comment.