mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
Add sender name to the notification
- also ensure that the created time is handled properly
This commit is contained in:
@@ -15,3 +15,6 @@ class EmailClient(Client):
|
||||
|
||||
def send_email(self, *args, **kwargs):
|
||||
raise NotImplemented('TODO Need to implement.')
|
||||
|
||||
def get_name(self):
|
||||
raise NotImplemented('TODO Need to implement.')
|
||||
|
||||
@@ -15,6 +15,10 @@ class AwsSesClient(EmailClient):
|
||||
def init_app(self, region, *args, **kwargs):
|
||||
self._client = boto3.client('ses', region_name=region)
|
||||
super(AwsSesClient, self).__init__(*args, **kwargs)
|
||||
self.name = 'ses'
|
||||
|
||||
def get_name(self):
|
||||
return self.name
|
||||
|
||||
def send_email(self,
|
||||
source,
|
||||
|
||||
@@ -15,3 +15,6 @@ class SmsClient(Client):
|
||||
|
||||
def send_sms(self, *args, **kwargs):
|
||||
raise NotImplemented('TODO Need to implement.')
|
||||
|
||||
def get_name(self):
|
||||
raise NotImplemented('TODO Need to implement.')
|
||||
|
||||
@@ -21,6 +21,10 @@ class FiretextClient(SmsClient):
|
||||
super(SmsClient, self).__init__(*args, **kwargs)
|
||||
self.api_key = config.config.get('FIRETEXT_API_KEY')
|
||||
self.from_number = config.config.get('FIRETEXT_NUMBER')
|
||||
self.name = 'firetext'
|
||||
|
||||
def get_name(self):
|
||||
return self.name
|
||||
|
||||
def send_sms(self, to, content):
|
||||
|
||||
|
||||
@@ -22,6 +22,10 @@ class TwilioClient(SmsClient):
|
||||
config.config.get('TWILIO_ACCOUNT_SID'),
|
||||
config.config.get('TWILIO_AUTH_TOKEN'))
|
||||
self.from_number = config.config.get('TWILIO_NUMBER')
|
||||
self.name = 'twilio'
|
||||
|
||||
def get_name(self):
|
||||
return self.name
|
||||
|
||||
def send_sms(self, to, content):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user