addFileAttachmentAsync not working on Office MAC #3717
-
Hello everybody, I need your help because I am having a problem integrating my solution with the addFileAttachmentAsync functionality on Office Mac because on other Office 365 online platforms or on Windows everything works. Despite several attempts, I cannot integrate inline pictures into my message body on Mac. Below is an example of testing integration that works everywhere except on Mac. In the logs I have ID attached element with the status succeded but the pictures are corrupted. When I analyze the source code of the message received I do not have any inline image in the email. Are you reproducing this problem and what would be the solution? Why does this only happen on Office Mac? insertInlinePictures();
function insertInlinePictures(){
var file_attachments_arr =
[
{
"name" : "gold_puppy.jpg",
"url" : "https://picsum.photos/200"
},
{
"name" : "black_puppy.jpg",
"url" : "https://picsum.photos/200"
},
{
"name" : "white_puppy.jpg",
"url" : "https://picsum.photos/200"
}
];
my_add_file_attachments_recursively_helper(file_attachments_arr, 0, "");
}
function my_add_file_attachments_recursively_helper(file_attachment_arr, index, message) {
if (index < file_attachment_arr.length) {
var file_attachment_obj = file_attachment_arr[index];
Office.context.mailbox.item.addFileAttachmentAsync
(
file_attachment_obj.url,
file_attachment_obj.name,
{
isInline: true,
"asyncContext" :
{
"message" : message,
"index" : index
}
},
function (asyncResult)
{
var next_message = asyncResult.asyncContext.message + "id : " + asyncResult.value + " , " + "status : " + asyncResult.status + "<br>";
my_add_file_attachments_recursively_helper(file_attachment_arr, asyncResult.asyncContext.index + 1, next_message);
debug("<div><img height=150 width=150 src='cid:" + file_attachment_obj.name + "'></div>");
}
);
}else{
debug(message);
}
}
function debug(message, details) {
console.log(message, details);
let log = "<div style=\"background:red;padding:5px;color:white;font-size:14px;\"> " + message + " </div>";
if( details !== undefined ) log += "<div style=\"background:black;padding:5px;color:white;font-size:14px;\"> " + details + " </div>"
Office.context.mailbox.item.body.setSelectedDataAsync(log, { coercionType: Office.CoercionType.Html });
} Thank you very much for your help ! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 9 replies
-
No one can help me or reproduce ? Please. |
Beta Was this translation helpful? Give feedback.
-
@exextoc Could you please assist with this issue? |
Beta Was this translation helpful? Give feedback.
-
@ShadowAnonymous Is it possible for you to share the video of the issue? We tried above snapshot and it does attach inline images on Outlook Mac.
); |
Beta Was this translation helpful? Give feedback.
-
@ShadowAnonymous The above add-in shared by you works as expected at our end. Can you check if "https://picsum.photos/200" is accessible for you and you are able to see the image when URL is opened in browser? If yes, can you share diagnostics ID. To collect diagnostics : Repro the issue and click on Help -> Collect Diagnostics. |
Beta Was this translation helpful? Give feedback.
-
We are able to repro this issue in 16.76.2 version. We have fixed the bug and the fix should be available in build 16.78 or later. When an updated build is available depends on the release channel a customer is on. |
Beta Was this translation helpful? Give feedback.
We are able to repro this issue in 16.76.2 version. We have fixed the bug and the fix should be available in build 16.78 or later. When an updated build is available depends on the release channel a customer is on.