Browse Source

Standardize alert notification language. (#4328)

ted kaemming 8 years ago
parent
commit
c5260da0b1

+ 2 - 2
src/sentry/plugins/sentry_mail/models.py

@@ -197,10 +197,10 @@ class MailPlugin(NotificationPlugin):
             )
 
     def get_digest_subject(self, project, counts, date):
-        return u'[{project}] {count} {noun} since {date}'.format(
+        return u'[{project}] {count} new {noun} since {date}'.format(
             project=project.get_full_name(),
             count=len(counts),
-            noun='notification' if len(counts) == 1 else 'notifications',
+            noun='alert' if len(counts) == 1 else 'alerts',
             date=dateformat.format(date, 'N j, Y, P e'),
         )
 

+ 1 - 1
src/sentry/templates/sentry/debug/mail/preview.html

@@ -16,7 +16,7 @@
         <option value="mail/unassigned/">Unassigned</option>
       </optgroup>
       <optgroup label="Alerts">
-        <option value="mail/new-event/">New Event</option>
+        <option value="mail/alert/">Alert</option>
         <option value="mail/digest/">Digest</option>
       </optgroup>
       <optgroup label="Account">

+ 1 - 1
src/sentry/templates/sentry/emails/digests/body.html

@@ -7,7 +7,7 @@
 {% block content %}
 
 <div class="container" style="padding-top: 30px;">
-  <h2>{{ counts|length }} new notification{{ counts|pluralize }} from <a href="{{ project.get_absolute_url }}">{{ project.name }}</a></h2>
+  <h2>{{ counts|length }} new alert{{ counts|pluralize }} from <a href="{{ project.get_absolute_url }}">{{ project.name }}</a></h2>
   {% with start=start|date:"N j, Y, P e" end=end|date:"N j, Y, P e" %}
     <div class="dateline">{{ start }}{% if start != end %} to {{ end }}{% endif %}</div>
   {% endwith %}

+ 2 - 10
src/sentry/templates/sentry/emails/error.html

@@ -4,11 +4,7 @@
 {% load i18n %}
 
 {% block preheader %}
-  {% if group.times_seen == 1 %}
-      New Issue on {{ project_label }}.
-  {% else %}
-      Regression on {{ project_label }}.
-  {% endif %}
+  New alert from {{ project_label }}.
 {% endblock %}
 
 {% block header %}
@@ -18,11 +14,7 @@
 
 {% block main %}
     <h2 style="margin-bottom: 15px">
-        {% if group.times_seen == 1 %}
-            New Issue on <a href="{% absolute_uri '/{}/{}/' group.project.organization.slug group.project.slug %}">{{ project_label }}</a>
-        {% else %}
-            Regression on <a href="{% absolute_uri '/{}/{}/' group.project.organization.slug group.project.slug %}">{{ project_label }}</a>
-        {% endif %}
+        New alert from <a href="{% absolute_uri '/{}/{}/' group.project.organization.slug group.project.slug %}">{{ project_label }}</a>
     </h2>
 
     {% if enhanced_privacy %}

+ 1 - 1
src/sentry/web/frontend/debug/mail.py

@@ -193,7 +193,7 @@ class ActivityMailDebugView(View):
 
 
 @login_required
-def new_event(request):
+def alert(request):
     platform = request.GET.get('platform', 'python')
     org = Organization(
         id=1,

+ 2 - 2
src/sentry/web/urls.py

@@ -133,8 +133,8 @@ if getattr(settings, 'DEBUG_VIEWS', settings.DEBUG):
 
     urlpatterns += patterns(
         '',
-        url(r'^debug/mail/new-event/$',
-            sentry.web.frontend.debug.mail.new_event),
+        url(r'^debug/mail/alert/$',
+            sentry.web.frontend.debug.mail.alert),
         url(r'^debug/mail/note/$',
             DebugNoteEmailView.as_view()),
         url(r'^debug/mail/new-release/$',

+ 2 - 2
tests/acceptance/test_emails.py

@@ -111,12 +111,12 @@ class EmailTestCase(AcceptanceTestCase):
         self.browser.snapshot('unassigned email txt')
 
     def test_new_event_html(self):
-        self.browser.get(self.build_url('/debug/mail/new-event/'))
+        self.browser.get(self.build_url('/debug/mail/alert/'))
         self.browser.wait_until('#preview')
         self.browser.snapshot('new event email html')
 
     def test_new_event_txt(self):
-        self.browser.get(self.build_url('/debug/mail/new-event/', 'txt'))
+        self.browser.get(self.build_url('/debug/mail/alert/', 'txt'))
         self.browser.wait_until('#preview')
         self.browser.snapshot('new event email txt')
 

+ 1 - 1
tests/sentry/plugins/mail/tests.py

@@ -243,7 +243,7 @@ class MailPluginTest(TestCase):
             mock.Mock(get_full_name=lambda: 'Rick & Morty'),
             {mock.sentinel.group: 3},
             datetime(2016, 9, 19, 1, 2, 3, tzinfo=pytz.utc),
-        ) == '[Rick & Morty] 1 notification since Sept. 19, 2016, 1:02 a.m. UTC'
+        ) == '[Rick & Morty] 1 new alert since Sept. 19, 2016, 1:02 a.m. UTC'
 
     @mock.patch.object(MailPlugin, 'notify', side_effect=MailPlugin.notify, autospec=True)
     @mock.patch.object(MessageBuilder, 'send_async', autospec=True)