diff --git a/src/communication/HISTORY.rst b/src/communication/HISTORY.rst index d0ae83a113..b1bfd07cd3 100644 --- a/src/communication/HISTORY.rst +++ b/src/communication/HISTORY.rst @@ -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. diff --git a/src/communication/azext_communication/manual/custom.py b/src/communication/azext_communication/manual/custom.py index 432be5a883..df211a51b9 100644 --- a/src/communication/azext_communication/manual/custom.py +++ b/src/communication/azext_communication/manual/custom.py @@ -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( diff --git a/src/communication/azext_communication/version.py b/src/communication/azext_communication/version.py index d58dd16691..7a498b8586 100644 --- a/src/communication/azext_communication/version.py +++ b/src/communication/azext_communication/version.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- -VERSION = '1.11.1' +VERSION = '1.11.2' def cli_application_id():