Can I build an addin for Gmail? - gmail

Is there a way I can create an addin for my Gmail account? Is GreaseMonkey the only real way?
I use Gmail for customer service, and I'd like to create a tool that looks up the customer and preps a response to them based upon who it is in my database... instead of looking by hand for the client and typing it out.

You can add gadgets (same as iGoogle and wave) and add them to the side bar in GMail, but you will not have access to the e-mails themselves. You could create small lookup forms and such, though.

I don't see how else you could do it. You won't be able to run your own app on Google's backend, so that leaves the client (with javascript and something like GreaseMonkey) and your server (perhaps communicating with the client via AJAX).

Related

How to integrate Chrome extension MV3 with PayPal

How can I use PayPal to charge users for feature(s) in my MV3 Chrome extension?
I'm specifically looking for PayPal as Stripe isn't supported in my country.
This is the first-ever time I'm trying to charge money for anything, so I wish to do it the right way the first time.
Also, my extension is open-source, so if I could make the code in a certain way to prevent the user from bypassing the storage to enable the feature without paying, it'd be cool.
You need a web server that provides services and payment verification if you want to prevent the user from bypassing anything.
Current versions of the PayPal Checkout require loading external JS resources, which browser extensions typically frown on. So the simplest solution, again, is going to be to have your extension direct over to a web page to handle the payment.
If you insist on processing the payment directly from your extension, the only possible way would be using a legacy HTML-only PayPal flow, most simply opening a tab to a link such as:
https://www.paypal.com/webscr?cmd=_xclick&item_name=payment%20purpose%20goes%20here&amount=100&currency_code=USD&business=receiverofpayment#emaildomain.com
This would not be at all secure or verifiable, other than perhaps if you were to also integrate the legacy IPN service on a server (also a bad idea).
So in summary, to do what you want to do you ought to pair a server and web page with your extension for payment processing/verification.
See the full stack example at https://developer.paypal.com/docs/subscriptions/integrate/ , and do API calls from your server's backend (in whatever programming environment, the node js there is just an example) for the order creation and capture. Your 2 server routes should be called from your web page, ideally using this approval flow includes a sample of error handling code for if the capture fails.

Is there an effective way to display Gmail correspondence using Node.js or React

I'm building a CRM that has individual contacts arrive through a contact page on the main website. Each contact needs to be emailed individually and the application will need to display the email correspondence. Essentially a client of Gmail.
I'm having a very difficult time tracking down a good starting point for this problem, and I was curious if any one else has given this a try, perhaps using the Gmail API.
Thanks!

Enable user to send text to specific Gmail contacts

In our website, we need to achieve a seemingly simple task: Enable the user to send a specific text to all or some of his/her Gmail contacts (including contact selection).
We don't actually need the contact data itself. We prefer some kind of "Gmail Plugin" (if there is one) that asks the user to login and does all the work. Alas, we couldn't find any.
We did find several different Google APIs related to this task. Some of them seem to give us contacts data. Others seem to handle sending email:
There is "Contacts API" under
https://developers.google.com/google-apps/contacts/v3/...
There is "Contacts Service" under
https://developers.google.com/apps-script/reference/contacts/...
There is "Gmail Service" under
https://developers.google.com/apps-script/reference/gmail/...
There is "Gmail Platform Integration" under
https://developers.google.com/gmail/...
Each of the above looks different and there seems to be much overlapping between them.
So what is the recommended method to achieve our original task? Is there a plugin that does it all? If not - should we use separate APIs for getting the contacts data and sending the emails, or are there Google APIs that combine both sub-tasks? In case those are separate tasks - is it possible to email via Gmail, or are there other recommended services for the email sending part?
To directly answer your question: you must use the first API you pointed, Contacts API under https://developers.google.com/google-apps/contacts/v3/.
Basically, you want to use the Google Contacts API with OAuth2 authentication in your website: user will be prompted by Google to allow your website to read user contacts.
First, read a bit about OAuth2 authentication flows here: http://alexbilbie.com/2013/02/a-guide-to-oauth-2-grants/
Second step: register your app on Google Console and get your key/pass for the Contacts API (you'll need contacts.readonly permission): https://console.developers.google.com
Then, as you'll use the OAuth2 for Web Servers, check this Google documentation: https://developers.google.com/accounts/docs/OAuth2WebServer
Alternatively, you can use third part libraries to easily import contacts to your website. There are free libraries, like PHP OpenInviter.org, Ruby OmniAuth gem, and paid alternatives, like CloudSponge.com (multi-language).
Disclaimer: I work for CloudSponge.com.
You could achieve this as you say with Google APIs and a Chrome Extension for example.
The user can add a Chrome Extension from the Chrome Webstore. The Extension will provide the user with a user interface to allow them to compose their message and send to the selected contacts.
The users contacts can be retrieved with the Google Contacts API.
The message can be sent to the selected contacts with the Gmail API.
There is a lot of documentation and examples for all of the above which together will give you what you want.
Depending on how much use this is going to get, you could use a contextual gadget which is browser agnostic - but visible in all emails in Gmail.
This is wrong the idea is to post the text to buffer a and submit pointer to array on buffet a and copy it to class b pointer a 0 than release the array and buffer so new allocation can be done

Add custom text to Sharepoint Email Alert

We have an alert set-up for sharepoint list, but I want to add some custom text to the alert email. We do not have any access to SPD or sharepoint server and can make changes to sharepoint client only.
Can anyone please advice?
The code that sends out emails runs on the SharePoint server via the Timer Job. Since you have no access to do anything with the server you've got absolutely no chance of modifying the built in alert emails.
Could you do this with javascript?
You can't send emails with JavaScript directly. You can open up a draft email in a users default email client using a mailto link but this won't achieve what you want as a user will still have to edit it.
You could, I suppose, put some javascript onto an edit page using a content editor web part (which you can do without SPD) to on changes make an AJAX call to a separate web server to do the actual sending.

How does gmail check gtalk statuses in real time?

How is it that if I have thousands of contacts (let's suppose) all around the world and one of them changes their status to away or becomes idol that it will change immediately in my browser?
It isn't instant really, there is a small delay, basically when you load the gmail page in your browser you also download a javascript file that refreshes the content dynamically via ajax. Similarly if a contact of yours changes gtalk status and you're using the gtalk client in gmail that change will be reflected after the next time the page you're viewing asks the server for updates. It's just constantly checking with the server for changes (the event oriented paradigm isn't really prevalent on the web).
I'm not sure of the exact mechanism gmail uses, but a fairly dumb way would be to have the page poll (via XMLHTTPRequest, aka AJAX call) the servers every X seconds for a change in contact statuses since N seconds ago... then apply those changes.
Google chat system is based upon XMPP protocol and Gmail chat block is just like another XMPP client (similar to gtalk,pidgin,psi for desktops). XMPP runs over browser using Bosh extension. Though i m sure google must have hacked to get it working in their own way, but underlying idea is still the same.
In short, when one of your contact update his/her status, it is being pushed to the google chat xmpp servers which in turn pushes that information to your gmail chat client.

Resources