Manipulate the content of an email with gmail add on - gmail-api

Hi I am trying to develop a plugin for gmail that will read emails and manipulate the content of the email when it is read within gmail.
More specifically I want to change certain words within the email message.
I've already developed a plugin that can retrieve the email message and manipulate the message as a string but I don't know how to redisplay it.
Is this possible to do? If so which API do I need to use?

I wouldn't have thought you could change the content of an email once in Gmail other than to change labels etc.
One approach that might work would be to manipulate the email in the Gmail UI by using a Browser plug-in such as a Chrome Extension.

Related

Send email with reset password link based on project

I have two projects where both of them use same firebase project. My problem is I want forgot password in both of the projects and both of them should point to different url in the respective project. Any help will be appreciated.
What I have achieved?
I have done forgot password for the first project and I get a email with link, for the second project I want email with different link (I am getting same link).
Any help will be appreciated.
There is only one password reset template per Firebase project, so you can't use the built-in template password reset flow to send different emails to different users in a single project. This usually isn't a problem, as the apps in a Firebase project are meant to be part of a single logical application.
If your use-case must use a single Firebase project, have a look at implementing a custom email handler, which is the page that the email links to.
If that is not enough, you can take control of the complete password reset flow yourself. This gives you full control of the emails that are sent, but does mean that you also have to arrange how to send that email and all actions from it yourself. For the actual password change, you'd then typically use the Admin SDK to update the user profile in a trusted environment.

Open Gmail Client With File Already Attached

I see you can send emails with uploaded attachments using the Google Gmail API. However, I want the user to be able to preview the email before sending. It looks like there isn't a way to do this?
So essentially would the only solution be to create my own simple email client, then send the email through the API? Or would using the API even be necessary as in that case I could just use the server's native sendmail client to sent out the email with the user's gmail address as the return address.
I guess using the API, the advantage is the email would appear in the user's SENT folder.
Unfortunately, I don't think there's a live preview that's available in a way you intended. As far as I know, Outlook (for reference) doesn't even have it. What they have is to upload the attachments while the mail is still being drafted.
The best I can think of is once the message will be sent, save it as draft at first and retrieve the mail again on the succeeding page. This will look like a preview that you intended. Once done, you can then finally send the drafted email to the receipients.

Email to automatically add calendar reminder to their calendars

Is there a way to send mass email and automatically add a calendar reminder the users' calendars? I've found you can export an .ics file and link to that where users can import into their program of choice, but what about something that will do it automatically to any calendar? I've used this article to follow, but nothing for automatically adding to the user's calendar nor do we use that email service.
http://www.whatcounts.com/2013/07/feature-friday-add-calendar-events-in-publicaster-edition/
You can not force someone to automatically download the .ics, as you can imagine, auto downloading anything in email would pose a security risk to the reader.
All you can do is host the .ics (or any file really) on the web and hyperlink to it with a 'Save to Calendar' type linkin your email.
I believe there is no way to do this automatically. One of the important reason is JavaScript is not allowed by most of the email client.
I think the best way to show user a event and make it easy to add to their calendar is generate a .ics file and attach to the email as an attachment. Many email client, like Gmail, will find it and display it as a part of the email.
Here is a reference of .ics file format http://en.wikipedia.org/wiki/ICalendar

Google app add attachment option to email

I want to create a google app that will let you add a file from a cloud service as an attachment to an email. From reading the google documentations it seems like you can't do anything while the user is creating an email, but the attachments.me app is able to do it. When composing an email, their app will pop up a button next to the regular attachment app letting you select an attachment from the cloud. I am new to working with google apps and I do not understand how attachments.me is able to do this. If anyone has an idea as to how this is possible please let me know, thanks.
To add features to the GMail UI you'd probably have to implement this as a Chrome extension (and/or Firefox or IE extension to support those browsers). In fact, this is apparently how attachments.me does it.
What the extension does is load when you go to gmail.com, identify a place in the UI where it wants to add its button(s), and inject them using JavaScript. You may then want to use JavaScript again to do something like add a link to the text of the email before it gets sent to the media you want to attach from the cloud, or intercept the "Send" button to tell your server to send the message with the cloud attachment included (assuming the user has authorized your server to send as them -- this can have serious security implications)
Beware, modifying complex web app UIs like GMail's using a Chrome extension can be very difficult; GMail may make changes that break your UI or functionality, and they may do it whenever they want, or only to a subset of users, so you'll have to constantly keep up with these changes to fix bugs. All in all I don't recommend it as a way of adding attachments to emails.

Testing Text-Based Emails

I am using Google AppEngine API to send an email to my application's users. The email fields accepts html and body, where the former is the HTML version of the email and the latter is the plain text form. I can easily test the HTML version (to see how it looks) by sending an email to myself. But I am wondering how I can test the plain text version if all of the email providers nowadays are HTML based?
Send an email to yourself, then view the source. In GMail, for instance, you do this by clicking on the down arrow in the upper right corner of the message, then clicking "Show Original".

Resources