I need to send a vizframe to email, to achieve this I converted the chart into an image. but I am unable to add this image to my email.
I can do same thing for text but not for an image.
i.e.: new sap.m.Text({text: "stackoverflow"}).getText() does the job for me.
any help will be highly appreciated.
UI5 only allows you to trigger the email client and pre-populate some plain text fields. You can check out the documentation for the URLHelper class.
If you also want to add an attachment (the picture), I don't think you will be able to. Check out this other question on StackOverflow: Automatically open default email client and pre-populate content. The only "good" way of doing it seems to be to just include a link towards your image inside the mail (assuming that the image is accessible via a URL).
Based on this question Press button, start native email program with attachment (located on webserver) it seems that some clients might allow you to specify the local path to the image (but in UI5 I don't see how you would know a path on the local machine).
Related
I want to create a form that works with ‘button id=“this” onclick=“sendToME”’ and I do not have my email reavealed (unless they open the console) at the moment of sending the data from the form.
The proper way to achieve your goal is to make an api endpoint (the button should point here), which are handle the process of email sending.
So, I feel like I'm really close to a breakthrough here but moving forward is going to require some help.
I have a survey, we will call it "test".
To get to the survey, you click a link that has your email included as a jscript passthrough (e.g., https://osu.az1.qualtrics.com/SE/?SID=SV_abcdefg&ID=john.doe#emailtest.com)
I want to autoauthenticate john doe against a panel.
What I mean by that is that I want to use an authenticator that doesn't require a person to enter any data, but uses the data in the URL as an authenticator. You would think this can't be done, but I've also learned that you can run javascript in the description field by looking at:
https://sites.google.com/a/cognitivescience.co/research-using-qualtrics/home/functions-capacities-in-qualtrics/using-qualtrics-as-a-personalized-web-service-with-the-authenticator
However, all that does is change the label for the field and doesn't actually authenticate. It does, however, process the next button. This suggests that if I can fill in the authenticator with the embedded data passed through the URL using JavaScript, I should be able to autoauthenicate.
Any ideas?
Strange example; I don't see how it ever would have worked. Anyway, if you add the embedded data field ID to your survey flow before the Authenticator, then you could put a script like the following in label field:
<script>Qualtrics.SurveyEngine.addOnload(function(){$$('.InputText').first().value="${e://Field/ID}";$('NextButton').click();});</script>
I have a PDF that has a button with field name ctaButton.
ctaButton currently has a url pointing to https://mywebsite.com.
I want to host the PDF on my server at https://mywebsite.com/hosted.pdf.
And when I send someone a link to the PDF, I want to attach a UTM_term parameter ?utm_term=customer1 and then have the PDF read this parameter and update the ctaButton url to https://mywebsite.com/?utm_term=customer1.
I've been messing around with the Javascript actions in Acrobat for a couple of hours trying to make this happen. Any help greatly appreciated.
You can get the full url to the document using...
var myURL = this.url;
"this" in Acrobat JavaScript is the document context.
I did hours of research and came to this conclusion – Javascript in Acrobat is like trying to code in 1985 AND browsers will not execute whatever code you come up with.
So I used this workaround:
When I send the PDF to someone, I send it as a link with a base64
encoded stringified JSON package that contains a bunch of tracking
data but importantly, the name of the file to access as well as utm
parameters specific to the recipient
The link hits a server handler (NodeJS) that extracts the encoded
JSON package, and uses the data in the package to serve up an HTML
redirect page pointing to the right PDF file
Importantly, the HTML page also saves the JSON package to the
browser's localStorage . . . this comes in handy in subsequent
steps
The PDF file opens in browser (it doesn't have to, could be opened on
desktop) and the call to action link has a link to a get request
handler
The get request handler serves up ANOTHER redirect page
This second redirect page accesses the browser's local storage, looks
for the utm parameters I set for that user, and then redirects to the
sale page, with nice utm parameters attached
So to sum up, you don't add the utm parameters to the call to action link in the PDF (because that would make the world too easy to live in) and instead you do all these acrobatics (no pun intended) to attach utm parameters in the link clicks (via JSON strings saved in localStorage) during the process (i.e. when user opens email to extract file via link, and then when user clicks call to action in the PDF).
Any questions or clarifications please let me know in the comments and I will do my best to address.
Caveats
Only works if user uses same browser in all steps (i.e. if Susan opens the email in Safari, saves the PDF, then clicks the call to action in the PDF, and the link opens in Chrome, utm parameters will not be passed).
Assumes browser is modern and has localStorage
UPDATE: I came across another solution. It's a bit more convoluted. Diagram below.
Porky.io is a Javascript extension for Adobe Indesign. So flow is:
send Porky.io the customer data you need (e.g. utm's for links)
Porky.io generates PDF from a template you provide with the customer data you provided
Listen for a new file save from Porky
Do something with the file (e.g. email it to customer)
I believe you need to run an instance of Windows somewhere in the cloud (e.g. on Azure) to run Indesign with the Porky.io. Unless you want to rely on your laptop.
My project's not big enough yet to warrant setting this up . . . but good alternative if I need to make my current solution more robust.
OK, I have a Form in my web application used to fill out some shipping details. Certain orders require printing this form, to accomplish this I have a Div on the page with the display style set to none. It contains our company logo, shipping information and a table that is dynamically populated with information from the form once the Print button is selected. I am using the InnerHTML of the Div to print with a JavaScript function to print the form.
My problem is I also need to optionally email this as a file attachment.
The only way I can see this working would be to save this Div to a file in my application and then attach it to the email.
I have had no success trying save the HTML in to a file though.
I am not stuck to this approach, I am looking for a direction to go in.
My only requirements are that the information is sent as an attachment and is visually appealing - including our logo etc.
Thanks for any help - I didn't include any code, didn't seem relevant.. let me know if you want my print function of anything else from the project.
You need to improve the design of your application. First, it should be the server side not the client sending the email or processing the order. So forget about JavaScript here unless you are using node.js on the server side. Your server side serves the HTML for the client to display, ideally it is dynamically generated from bits and pieces or using some sort of template. As soon as you have that you can use the same code that generates the HTML served to the client to generate HTML send via email. It may have differences but most building blocks can be reused. Having done that just use whatever email library is available, set the content type to HTML, provide the dynamically generated HTML as the body and off it goes. None of that is done in the client JavaScript.
At a form, I have a file input field (for image) and I want to add an optional way to fill this field by fetching data via ajax API and this returns me the URL of an image.
How can I set the content of the field input as the URL image, especially is it possible without passing a hidden a hidden text field to pass this image URL to the server?
File inputs are for uploading the content of files from the client to the server. Since browsers won't let you (as a page author) download a file on behalf of the client, this isn't possible.
If what you were asking was possible, I could make you download a multi-gigabyte file just by making you visit my webpage. That wouldn't be a good situation to be in.
If you don't want the user to download and re-upload a file, then you don't want a file input. The other solution you mentioned (a field just containing the URL) sounds perfect for this.