Skip to content

Commit

Permalink
Adding an error message for incorrect formats of inline attachments i…
Browse files Browse the repository at this point in the history
…n Email communication send mail.
  • Loading branch information
v-vprasannak committed Oct 25, 2024
1 parent 9ec9484 commit 821b968
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/communication/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Release History
===============
1.11.2
++++++
* Adding an error message for incorrect formats of inline attachments in Email communication send mail.

1.11.1
++++++
* Fix bug in Email services - send email with attachments.
Expand Down
5 changes: 5 additions & 0 deletions src/communication/azext_communication/manual/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ def prepare_attachments(attachments, attachment_types, inline_attachments):

# Process inline attachments
for j, inline_attachment in enumerate(inline_attachments):
if inline_attachment.count('/') != 1:
raise CLIError(
f'Incorrect format for inline attachment: {inline_attachment}. '
'Format should be: FileLocation/ContentId, example: "ImageName.png/image".'
)
attachment_name, content_id = inline_attachment.split('/')
inline_attachment_type = attachment_types[len(attachments) + (j)]
attachment_content = __get_attachment_content(
Expand Down
2 changes: 1 addition & 1 deletion src/communication/azext_communication/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# --------------------------------------------------------------------------------------------


VERSION = '1.11.1'
VERSION = '1.11.2'


def cli_application_id():
Expand Down

0 comments on commit 821b968

Please sign in to comment.