Skip to content

Commit

Permalink
[communication] add support for multiple sms recipients (#4967)
Browse files Browse the repository at this point in the history
* [communication] add support for multiple sms recipients

* [communication] update version and release history
  • Loading branch information
mayssamm authored Jun 11, 2022
1 parent 028429e commit 2c7133a
Show file tree
Hide file tree
Showing 8 changed files with 890 additions and 7 deletions.
5 changes: 5 additions & 0 deletions src/communication/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Release History
===============

1.1.2
++++++
* Add support for multiple SMS recipients.


1.1.1
++++++
* Fix codestyle issues in communiction command group.
Expand Down
2 changes: 1 addition & 1 deletion src/communication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ az communication identity issue-access-token --scope chat voip --userid "8:acs:x
##### Send-SMS #####
```
az communication sms send-sms --sender "+1833xxxxxxx" \
--recipient "+1425xxxxxxx" --message "Hello there!!"
--recipient "+1425xxxxxxx" "+1426xxxxxxx" "+1427xxxxxxx" --message "Hello there!!"
```
##### List-Phonenumbers #####
```
Expand Down
4 changes: 2 additions & 2 deletions src/communication/azext_communication/manual/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@

helps['communication sms send-sms'] = """
type: command
short-summary: "Sends an SMS from the sender phone number to the recipient phone number."
short-summary: "Sends an SMS from the sender phone number to the recipient(s) phone number."
examples:
- name: send sms
text: |-
az communication sms send-sms --sender "+1833xxxxxxx" \
--recipient "+1425xxxxxxx" --message "Hello there!!"
--recipient "+1425xxxxxxx" "+1426xxxxxxx" "+1427xxxxxxx" --message "Hello there!!"
"""

helps['communication phonenumbers'] = """
Expand Down
3 changes: 2 additions & 1 deletion src/communication/azext_communication/manual/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def load_arguments(self, _):

with self.argument_context('communication sms send-sms') as c:
c.argument('sender', options_list=['--sender', '-s'], type=str, help='The sender of the SMS')
c.argument('recipient', options_list=['--recipient', '-r'], type=str, help='The recipient of the SMS')
c.argument('recipients', options_list=[
'--recipient', '-r'], nargs='+', help='The recipient(s) of the SMS')
c.argument('message', options_list=['--message', '-m'], type=str, help='The message in the SMS')

with self.argument_context('communication phonenumbers show-phonenumber') as c:
Expand Down
4 changes: 2 additions & 2 deletions src/communication/azext_communication/manual/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def issue_access_token(client, scopes, userid=None):
return user_token_data


def communication_send_sms(client, sender, recipient, message):
return client.send(from_=sender, to=recipient, message=message)
def communication_send_sms(client, sender, recipients, message):
return client.send(from_=sender, to=recipients, message=message)


def communication_list_phonenumbers(client):
Expand Down
Loading

0 comments on commit 2c7133a

Please sign in to comment.