I'm using Outlook Web Add-in. I need a way to send an email automatically. Something similar to this:
var item = Office.context.mailbox.item;
item.displayReplyAllForm("Default Message");
but without showing the Reply Form. I need to send a message directly and
maybe only show a message like "replying... please wait" or something similar when I click the button.
How I can do that? Please help and thanks a lot.
You cannot do this from the JavaScript library directly. You would need to use Microsoft Graph API to handle sending the message. You can find instruction on how to do this in the documentation under Use the Outlook REST APIs from an Outlook add-in.
There are couple of solution one is with graph and another is with exchange api. For graph you need to little bit of extra work to get the token and auth flow working.
The other approach is to use exchange API, you don't need to do anything to do these calls you already have the authentication setup needed for you in dong this call.
Please see this documentation for the more details.
https://msdn.microsoft.com/en-us/library/office/dd633704(v=exchg.80).aspx
https://learn.microsoft.com/en-us/outlook/add-ins/web-services
If you want a client only solution you can directly call the Office.context.mailbox.makeEwsRequestAsync API (refer documentation here: https://dev.office.com/reference/add-ins/outlook/1.5/Office.context.mailbox?product=outlook)
To construct the soap request to be used in makeEWSRequest, you can use: https://msdn.microsoft.com/en-us/library/office/dn600292%28v=exchg.150%29.aspx?f=255&MSPPError=-2147217396
Note that makeEWSRequest is not supported in mobile clients.
You should ideally request for a graph token using getCallbackTokenAsync API and then use the graph APIs with the token to send the email. This should work on all clients and is a preferred way to accomplish this scenario.
Related
I am looking to send emails to users showing all of the new posts the people they follow had in the last week. I have the site looking as I want, is there a way to embed the html from a website into an email using an API?
Some examples of this are when Facebook sends you an email with all of the recent posts your friends have had, or when Asana sends each user an email with their outstanding tasks.
Anyone have a good idea on how to tackle this?
I have tried using mailchimp and a few competitors to see if I could just pass them the posts for each user but after talking to their support it doesn't seem possible
You could use EmailJS in order to do this, which is a service providing you an API to send eMails based on templates you can create using their UI. The bad side is that it adds Sent by EmailJS at the end of the mail if remember correctly.
Or you can build your own API with Express on NodeJS (or anyother langage: PHP, Python..) and use a library like nodemailer.
Hope it helps :) Good luck !
I am testing some code on Outlook 2016 & Outlook Web using Script Lab.
My use case is simple: when I click on a button in my addin, I want the email to be delivered 2 days after today when it is sent. I know it is possible directly in the interface but this is just a test for a biggest addin later.
I am trying to set the Delay Delivery (or Send Later on Outlook Web) feature on emails through the Javascript API.
I went on the API reference but I was not able to find how to change the Delay Delivery property of emails.
Is it possible to edit this property using the API?
Does anyone know how to do that?
Thank you for your help
OfficeJS doesn't provide anything for that out of the box. But you may consider using EWS, see Call web services from an Outlook add-in for more information. The How to: Delay sending an email message by using the EWS Managed API 2.0 article explains how to delay sending an email message by using the EWS Managed API.
Another possible option is Graph API.
I just want to request my viewCount, subscriberCount and videoCount. All these three things are listed when I open this url in my browser.
I am working with JavaScript. All I want to do now is save this three variables and display them on my website. No authentication is needed.
I tried a lot of code examples but it never worked. I have no idea how this works. Please help me!
if you look in the reason of the invalid request it tells you that a key is needed.
In fact, as almost all the google API services nowadays, you need to register your application and get an API key that will replace the value of the parameter key in your url (Now it is set as a demonstration as key=MY_API_KEY).
Here is the link for the guide to app google registration.
Hope this answer can be useful to you.
I am trying to create a web form that will post data to my google sheet. I am finding that the only way to do this is to use OAuth2 where the client needs to authenticate with google. Is there a way that I can post to my own sheet without having to do the OAuth? I want to avoid having the google screen popup when trying to submit the form. Anyone know how to do this, without a hack? If it has to be done server-side, I am using PHP. Thanks
If it's your Google sheet that you are using for all visitors, then you only need to follow the flow once to obtain a refresh token and use a service account. This obviously has to be done server-side, otherwise you expose your credentials to every visitor.
This guide Using OAuth 2.0 for Server to Server Applications explains the process.
I wanted to post to Google+ user stream with an extension via Javascript. I know Google+ has no APIs yet, but I've seen this done with a PHP api. Does anyone have pointers as to where to start implementing this? I don't need anything fancy: just ability to post into the stream. Thanks.
http://www.google.com/intl/en/webmasters/+1/button/index.html
here you can generate code you needed.
For anyone else that finds this - there is a Javascript plugin available
https://github.com/yipyo/google-plus-extension-jsapi
However this will only work as a browser extension because it will require access to the Google Plus page user.
I don't believe you could do it any other way and currently the API only allows read access unfortunately.
As far as I am aware right now the google plus api released is only read access.You can't pull data from it
https://developers.google.com/+/api/
We will have to wait for them to release......