When using Office.js to retrieve the body of an email that has inline attachments, we receive HTML like this:
<div>
<div dir="ltr">
<div style="color:black;font-size:12pt;font-family:Calibri,Arial,Helvetica,sans-serif;background-color:white;">
This email has images in the body.</div>
<div style="color:black;font-size:12pt;font-family:Calibri,Arial,Helvetica,sans-serif;background-color:white;">
<img data-imagetype="AttachmentByCid" originalSrc="cid:ab24f213-f1a6-4804-ad70-25a4d3ac5f86" naturalHeight="0" naturalWidth="0" src="cid:ab24f213-f1a6-4804-ad70-25a4d3ac5f86" data-outlook-trace="F:1|T:1" tabindex="-1" size="9026" style="max-width:100%;">
<img data-imagetype="AttachmentByCid" originalSrc="cid:be90d9aa-49a6-48fb-b4b9-d50950aefae3" naturalHeight="0" naturalWidth="0" src="cid:be90d9aa-49a6-48fb-b4b9-d50950aefae3" data-outlook-trace="F:1|T:1" tabindex="-1" size="60886" style="max-width:100%;">
<br>
</div>
</div>
</div>
Where the <img> tags are where the inline image attachments would be.
The attachments property on the mailbox item lists attachment metadata like this:
{
attachmentType: "file",
contentType: "image/jpeg",
id: "AAMkADFlM2Q0MzdkLTJhZWQtNGQzNS05YWI2LWMwYmNkZmMwODNmZgBGAAAAAAAbEbu84Nj1SIfOZGQpQsg/BwC74mYLmMGJSYnZmTQHpD7TAAAAAAEJAAC74mYLmMGJSYnZmTQHpD7TAAE1znR7AAABEgAQACz3QOlxzApEvhIoK7iHWoc=",
isInline: true,
name: "home_team.jpg",
size: 9341
}
I can't any link between the first image tag and this attachment object. Is there some other way of identifying where each inline attachment is in the message?
The Office.AttachmentDetails interface doesn't provide any property for the content ID value. You need to use EWS to get a property value. See Call web services from an Outlook add-in to get started quickly. The Attachment.ContentId property gets or sets the content identifier of the attachment. ContentId can be used as a custom way to identify an attachment in order to reference it from within the body of the item that the attachment belongs to.
Currently, the feature to get the cid of inline attachments, you requested, is not a part of the product. We track Outlook add-in feature requests on ourĀ user-voice page. Please add your request there. Feature requests on user-voice are considered, when we go through our planning process.
Related
I am developing outlook add-in on Outlook for mac 16.24(19041401). I tried to insert html to meeting body. The html is href for skype in . When end user tried to use add-in change the the skype number, I tried to use outlook-addin to read the meeting html body. But I got 2 issues.
1. "" isn't in the html body like I inserted into the body.
2. The Skype href doesn't have "skype://xxxxx?call", just give me a . Anybody have the same issue with me?
I insert the body:
<div id="skypelink" style="vertical-align:middle;display: inline-block">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUEAIAAABSe1YZAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzo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TiWDFSANob4NqkjynjnnXpQSAIhHmAXQxKNqQW6UXmMq/y0hy2cyKUERQj3rNnnCRYB3Y+mj9db6lUyxikWzBqi5bqpDYoOub61S0plpCVRyonv82qk2LsqvloZ7axVkGDcQHry73qqH0fG9dKfhhpAAwP38V/b3AACRBCM6Iaa5AAAAAElFTkSuQmCC">
<span>Join Call</span>
</div>
Use outlook read the html body:
<p class=MsoNormal style='vertical-align:middle'><img border=0 width=13
height=13 style='width:.1354in;height:.1354in'
src="~WRS%7b2F8FB628-6315-8E46-8398-0F1A181C67F9%7d.fld/image006.jpg"
style='height:.135in;width:.135in'
alt="/var/folders/63/dwr3c3t12szbjc66m_kxk5300000gp/T/com.microsoft.Outlook/Content.MSO/41334F0E.tmp"><span
style='font-family:"Microsoft YaHei UI",serif'><span class=MsoHyperlink><span
style='font-size:9.0pt;color:#1AB394'>Join Call</span></span></span><span style='font-family:"Microsoft YaHei UI",serif'> </span></p>
Am working on a Laravel project whereby am fetching some response from an API and storing in a variable. Basically the response is pdf document code which when clicked will open as a PDF document on the browser,,
After fetching it am storing in a variable and then passing to the view. On the view I Have created an anchor tag which when clicked the embedded document should open but it aint working as expected
Controller Hitting the API and getting the response
public function createQuote(){
$dat = [
'sts_quote_number' => $quoteRef
];
//STS PDF Quote
$quotePdf= $this->global_Curl_Meta(
$dat, 'api/v1/travel/sts-quote-doc')->data;
//dd($quotePdf);
$quote_data = view("B2C::travel.quote", compact('quotePdf'))->render();
}
Response after dd($quotePdf)
data:application/pdf;base64,JVBERi0xLjQKJaqrrK0KNCAwIG9iago8PAovQ3JlYXRvciAoQXBhY2hlIEZPUCBWZXJzaW9uIFNWTiB0YWdzL2ZvcC0xXzEpCi9Qcm9kdWNlciAoQXBhY2hlIEZPUCBWZXJzaW9uIFNWTiB0YWdzL2ZvcC0xXzEpCi9DcmVhdGlvbkRhdGUgKEQ6MjAxODEyMjcxMTQwMDYrMDInMDAnKQo+PgplbmRvYmoKNSAwIG9iago8PAogIC9OIDMKICAvTGVuZ3RoIDExIDAgUgogIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0cmVhbQp4nJ2Wd1RU1xaHz713eqHNMNIZeu9tAOldQHoVhWFmgKEMMMwAIjZEVCCiiIhgAwkKGDAaisSKKBaCggL2gAQBJQaj2FDJjKyV+PLy3svL7497v7XP3ueeXc5aFwCSdyorLQuWAiCNJ+AHe7nSI6Oi6dh+AAM8wAAzAJisrAz/EM9QIJKPhxs9S+QE/kWvhwEkft8yEu8F/j9JszL4AgCgQBFbsDlZLBEXijg1R5Ahts+KmBqfImYYJWa+6IAilhNz4iIbfvZZZGcxs9N4bBGLz5zBTmOLuUfEW7OFHBEjfiIuyuZyckR8W8SaqcI0rojfimPTOExRDiiS2C7gsJJEbCpiEj802E3ESwHAkRK/4PgvWMDJFYiTckvPWM3nJiYJ6LosPbqZrS2D7s3JSeUIBEaBTFYKk8+mu6WnZTB5qwFYzPmzZMS1pYuKbG1ma21tZG5s9kWh/uvi35S4t4v0MuhzzyBa3x+2v/.....
Anchor tag on the viw which when clicked the div containing embedded PDF should open
<td colspan="2">
<i class="fas fa-print quote"></i>
<!--Anchor tag to click-->
Print Quote
<!--The div to open-->
<div id="d"><embed src="{{ $quotePdf }}" height="750px" width="750px"></div>
</td>
I am trying build a custom dojo 1.9 widget with template support. I need to pass text value and image (stored in POJO) into the widget when I do Instantiation.
I found some example from:
http://dojotoolkit.org/reference-guide/1.10/quickstart/writingWidgets.html#quickstart-writingwidgets
there are some templates with text field and button that accept value by using data-dojo-attach-point. But I never find a template example accept image. Does any one have one full example meet my requirement?
<div class="${baseClass}" data-dojo-attach-point="focusNode"
data-dojo-attach-event="ondijitclick:_onClick"
role="menuitem" tabIndex="-1">
<div data-dojo-type="dijit/form/Button"
data-dojo-attach-point="buttonWidget">
My Button
</div>
<span data-dojo-attach-point="containerNode"></span>
</div>
Please help!!
The issue was fixed by myself.
Dojo Dialog and html5 configure tag was used. This way is a work around to support title and image caption, eventually have to wait for dojo LightBoxNano widget (probably 2.0 or newer version) to support image caption.
Dojo snippet code:
var theconfigure = "<figure><img src=\"data:"+returnData.fileType+";base64,"+returnData.fileData+"\" width=\"400\" height=\"300\">"+
"<figcaption>"+returnData.fileDesc+"</figcaption></figure>";
var myDialog = new dijit.Dialog({
title: returnData.relatedLocation,
content: theconfigure,
style: "width: 410px"
});
myDialog.show();
The result looks like:
I have this piece of javascript code
<script language="javascript">
function editRecord(email){
window.open('CompleteProfileDisplay.jsp?email='+email);
f.submit();
}
</script>
My question is how to hide the email value in address bar while calling CompleteProfileDisplay.jsp page through window.open function.One more thing CompleteProfileDisplay.jsp accepting the email value as request.getParameter method.Please help me if anybody is having idea.
The open() method takes a second name parameter which you can use as the target of a post, so you can create a hidden form with a target, open about:blank with a the target name and submit that form.
Or you can have a form that submits to the special '_blank' target which also opens a window. Similarly you programmatically fill and submit the form.
Edit: I said '_new' which is wrong....
You can follow this outline to accomplish your goal:
Create a small form within your HTML, with its action property set to CompleteProfileDisplay.jsp, containing an input field named email, with a target of _blank, and a method of post.
Have your function set the value of the email input field of this form to the given email address and submit the form.
A popup window will open containing the same results as your original request, but the data (email address) will be submitted as a POST request without being visible in the URL.
Like this:
<!-- make sure this form isn't nested with another form in your page -->
<form action="CompleteProfileDisplay.jsp" target="_blank" method="post">
<input type="hidden" name="email" id="hiddenemail" />
</form>
<script>
function editRecord(email){
var e = document.getElementById('hiddenemail');
e.value = email;
e.form.submit();
}
</script>
(Your question does not show that you are customizing the popup window's appearance in any way, so I am not considering that in my answer.)
i have been working on this problem for hours.
I have a form, with a textarea. I use the nicEdit texteditor. It replaces the textarea and shows a nice text editor, because i want my users to add some style to their content.
I use codeIgniter (PHP), and i use the form_helper to create the form. Also i use the form_validation for ss-validation and jquery validation for cs-validation
When i click submit, the form submits seemingly fine. I say this because i use fiddler (an http logger) and i see my text with the right html tags wrapped around it by the text editor.
but when i get the #_pots data in the view, somehow some part of the tags have been removed.
How fiddler traces the HTTP call and the submitted form data (seems correct)
Hello SO, <br><br>
<span style="font-weight: bold;">the following line should be bold</span><br><br>
<span style="font-style: italic;">the following line should be italic</span><br><br>
<span style="text-decoration: underline;">the following line should be underlined</span><br>
How my html looks in my view and in my print_r result from my #_post data
Hello SO,<br><br>
<span bold;"="">the following line should be bold</span><br><br>
<span italic;"="">the following line should be italic</span><br><br>
<span underline;"="">the following line should be underlined</span><br>
It looks like somehow, when i get my data back, it removes the style="font-weight
Does $_post do anything with special characters?!?! has someone experienced similar issues with this?
all responses are greatly appreciated.
You need extend the CI_Security class from Codeigniter and comment/remove/modify this line:
/*
if(in_array($_SERVER['REQUEST_URI'],$allowed))
{
$evil_attributes = array('on\w*', 'xmlns');
}
else
{
$evil_attributes = array('on\w*', 'style', 'xmlns');
}
*/