mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-09 17:45:41 -04:00
DRY-up overriding shortcode with sender
This avoids duplicating the logic when we add a new provider.
This commit is contained in:
@@ -65,17 +65,16 @@ class FiretextClient(SmsClient):
|
||||
super().init_app(*args, **kwargs)
|
||||
self.api_key = self.current_app.config.get('FIRETEXT_API_KEY')
|
||||
self.international_api_key = self.current_app.config.get('FIRETEXT_INTERNATIONAL_API_KEY')
|
||||
self.from_number = self.current_app.config.get('FROM_NUMBER')
|
||||
self.url = self.current_app.config.get('FIRETEXT_URL')
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return 'firetext'
|
||||
|
||||
def try_send_sms(self, to, content, reference, international, sender=None):
|
||||
def try_send_sms(self, to, content, reference, international, sender):
|
||||
data = {
|
||||
"apiKey": self.international_api_key if international else self.api_key,
|
||||
"from": self.from_number if sender is None else sender,
|
||||
"from": sender,
|
||||
"to": to.replace('+', ''),
|
||||
"message": content,
|
||||
"reference": reference
|
||||
|
||||
Reference in New Issue
Block a user