Can you schedule emails on Gmail via GmailAPI? - gmail-api

I was writing some emails and sending them via Gmail API, I was trying to schedule them for the but through the Gmail API but I couldn't find any relevant documentation. Which make me wonder that is that even possible.

Answer:
The Gmail API does not have email scheduling functionality at present.
More Information:
There is already a report on Google's Issue Tracker which requests for this functionality to be exposed via the Gmail API:
Expose functionality for creating scheduled emails
Google does seem to know about this already, if it's a feature you would like to see be implemented sooner then I suggest that you hit the ☆ next to the issue number in the top left of the page, as it lets Google know more people would like to see the featureand so it is more likely to be seen to faster.
Workaround:
If you know at which time you would like your emails to be scheduled, and you have already authorised your application, then you can instead run your application using a cron job for your operating system.
References;
cron - Wikipedia

Related

How to secure an app engine app to be available only to Google Cloud Task?

I would like to create a task handler that is supposed to deal with some tasks with retry, etc.
But I want this endpoint to only be triggerable by a specific queue in google task ?
How am I supposed to deal with it ? What is the best practice ?
Best regards
UPDATE: Check Will's comment. This answer might be outdated and no longer work. Before applying it, be sure to test extensively.
According to the Cloud Tasks documentation, requests incoming from Cloud Tasks will have the X-AppEngine-QueueName header.
This header does not appear listed in the GAE docs about requests headers removed, but I just tested it and this header is also removed.
To secure your GAE app to only be called through Cloud Tasks, validate that the X-AppEngine-QueueName header is in one of the approved queues that you want to allow to call your app.

Programmatically modify cron schedule in Google App Engine

I am writing a wrapper around the Github Issues API to allow managers in my company to set up daily reminder emails to be sent to their devs. I want this to be configurable through an admin console, and give them the flexibility of setting up reminders at any time of day and any number of times a day.
The main App Engine cron system is configured statically through the cron.yaml file and cannot be changed by user action. Looking at the documentation it appears like I can only do this by reimplementing an entire cron infrastructure on top of the basic App Engine cron. Am I missing something? Is there anything like this that is already available elsewhere?
You are correct, you cannot setup programmatically the cron configuration.
You can configure a single cron which triggers a customized functions. This functions can read the configured crons (like datastore entities) and the launch different task based on your needs

Google API discovery possible within Google Apps Script?

I want to access an external Google API through a GAS trigger. Is it possible/advisable to use something like the javascript Google API client library, adapted for the GAS context, instead of manually using URL Fetch, as mentioned here ?
PS. I am trying to hit the Google App Engine TaskQueue service via its REST API.
In the Apps Script Code Editor, under the RESOURCES, ADVANCED GOOGLE SERVICES menu, you can enable different API's. I don't see an Advanced Service for anything the resembles a Task Queue. There is a Tasks API, but that's for Task List, which is very different than the Task Queue.
So, I don't think you have any choice but to use the REST API with UrlFetchApp.fetch() in server side gs code in Apps Script.
As far as the trigger is concerned, you might want to look at quota limits, if you're going to be running it a lot, or running code that takes a long time to run.
You can use external APIs with OAUTH2 as outlined here: apps-script-oauth2
It's just not built-in, but you can easily add it as a library as mentioned in the Readme.

Can I build mailing list software on Google App Engine?

I tried to search if it's legal or GAE will be able to support sending/receiving email just fine with mailing list kind of operation -- but so far I couldn't find anything useful.
Do you know if this is permissible or possible? Or even a good idea?
I'm thinking simple mailing list software for a single owner.
Yes you can build that, and in the GAE documentation is a good chapter about how to do that:
http://code.google.com/intl/de-DE/appengine/docs/java/mail/overview.html
If the fairly high quotas for sending mail:
http://code.google.com/intl/de-DE/appengine/docs/quotas.html#Mail
are not enough, you can ask for an increase. Not sure if that will cost you money.
App Engine does support sending and receiving email (see sending mail in App Engine and receiving mail in App Engine). The App Engine program policy prohibits sending spam emails (see the "Prohibited Actions" section), but as long as you are sending legitimate emails, there should not be a problem.
That said, if this is secondary to your main application (i.e. you just want to provide a mailing list as a support forum, for example), it may be easier to just use Google Groups for that functionality.

Adding Instant Messaging (possibly XMPP) to my website on AppEngine (without using Google Login IDs)

I have developed a dating website built on top of the Google App Engine, to which I would like to add instant messaging, and possibly/probably audio and video conferencing.
Given that the users on the website do not want to share their personal details or real contact information, I am handling all of the login information and sessions without assuming that the clients have (or even want) a google account ID or any other login that is associated with their real identity.
I would like to hear suggestions on how I could go about adding instant messaging to my website given that I cannot just directly access Google Talk or some other existing service.
Would it make sense to use XMPP for this, and if so will Google Talk or any other XMPP service provider allow me to register new user accounts without manual intervention (ie. after a user is registered on my site, automatically register them with the XMPP provider)? Or, if not, perhaps I can use a single google ID with Google Talk with a different resource identifier for each user (me#google.com/user1, me#google.com/user2, etc...), and send messages between the different resources? Could this work, and/or would having thousands of simultaneous connections to a single account get me banned from Google Talk?
Perhaps some kind of AJAX based solution might make more sense given the fact that users are already registered on my website, but are not registered for an XMPP service?
Any suggestions about how I might approach this problem would be greatly appreciated.
Kind Regards
-Alexander
Text chat is the easier problem. You can do either with or without XMPP. Without XMPP, you'll be building a Facebook chat type client on your pages that sends messages from each user to the app, and the app then shows then on the recipient's screen.(The client can be polling, or use comet when it comes out). Check out olark to see how this works.
Once you build code to use the app as a switchboard that routes the correct message to the correct person (anonymously, maybe), you can port this easily to XMPP if you require. Both parties add you.dating.site#appspotchat.com to their buddy lists, and you send all messages from girl#site.com to guy#site.com and vice-versa. (assuming a heterogeneous site.)
Audio and video, I have no clue how to do without sharing details between the parties :-/

Resources