Skip to content

Commit 9fb2dbd

Browse files
author
Marian Ganisin
authored
Merge pull request #131 from mganisin/subject-arg
Allow subject definition in send_message
2 parents 33b0512 + 3dc87ed commit 9fb2dbd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

threescale_api/resources.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def set_plan(self, entity_id: int, plan_id: int, **kwargs):
198198
instance = self._create_instance(response=response)
199199
return instance
200200

201-
def send_message(self, entity_id: int, body: str, **kwargs) -> Dict:
201+
def send_message(self, entity_id: int, body: str, subject: str = None, **kwargs) -> Dict:
202202
"""Send message to a developer account
203203
Args:
204204
entity_id(int): Entity id
@@ -208,6 +208,8 @@ def send_message(self, entity_id: int, body: str, **kwargs) -> Dict:
208208
"""
209209
log.info("[MSG] Send message to account (%s): %s %s", entity_id, body, kwargs)
210210
params = dict(body=body)
211+
if subject:
212+
params["subject"] = subject
211213
url = self._entity_url(entity_id=entity_id) + '/messages'
212214
response = self.rest.post(url=url, json=params, **kwargs)
213215
instance = utils.extract_response(response=response)

0 commit comments

Comments
 (0)