Skip to content

Commit

Permalink
Added an error message for incorrect formats of inline attachments in…
Browse files Browse the repository at this point in the history
… email communication service send email. (#8199)

* Adding an error message for incorrect formats of inline attachments in Email communication send mail.

* Added an error message for incorrect formats of inline attachments in email communication service send email - style issue
  • Loading branch information
v-vprasannak authored Oct 28, 2024
1 parent 9ec9484 commit 8f612e0
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 8f612e0

Please sign in to comment.