mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 05:29:38 -04:00
Show inbound messages on the dashboard
This commit adds two things: a section on the dashboard to show how many inbound messages the service has received in the last 7 days, and how recently an inbound message has been received --- Doesn’t show the contents of any messages, just like how the rest of the dashboard is an aggregation, never individual messages. a page to show all the inbound messages the service has received in the last 7 days --- This shows the first line of the message. Eventually this will link through to a ‘conversation’ page, where a service can see all the messages it’s received from a given phone number.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from flask import url_for
|
||||
from app.utils import BrowsableItem
|
||||
from app.notify_client import _attach_current_user, NotifyAdminAPIClient
|
||||
@@ -237,6 +238,16 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
params=dict(year=year)
|
||||
)
|
||||
|
||||
def get_inbound_sms(self, service_id):
|
||||
return self.get(
|
||||
'/service/{}/inbound-sms'.format(service_id)
|
||||
)['data']
|
||||
|
||||
def get_inbound_sms_summary(self, service_id):
|
||||
return self.get(
|
||||
'/service/{}/inbound-sms/summary'.format(service_id)
|
||||
)
|
||||
|
||||
|
||||
class ServicesBrowsableItem(BrowsableItem):
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user