Google Drive Email Recipient Quota - google-apps-script

Referencing this limit: https://script.google.com/dashboard
We have a few forms through our Google Drive, and I use the FormEmailer script (placed in the script editor) to send out a summary notification to two recipients once someone fills it out.
Occasionally, we will have a meeting/gathering where a whole bunch of people will fill out these forms at once.
I did a good amount of research on this but I am getting conflicting information. Some webpages say you can't increase that limit, some say you can (how? We would be willing to pay). It's not a whole lot of extra e-mail, maybe 200 a day instead of the 100 limit.
I see this page but don't see a way to increase it: https://developers.google.com/apps-script/guides/services/quotas
Thanks!

There's no way to increase the limit for Google Apps script.
One possible work around here is to have multiple scripts that perform the same function, and send script1 to some people, and script2 to others or something similar. Alternatively if the two recipients are always the same 2 people, you can consider placing them in a group, and sending the email to the group instead, which counts as sending to only 1 person (Thus doubling your current limit).

Related

Gmail limits between consenting gmails

I am using a gmail account to selectively forward incoming mail to the correct recipient based on criteria in the incoming mail. Bear in mind I can't solve this using Gmail filters. I need to run Apps script in order to look up the sender in a database before deciding who to forward the mail to.
I quickly hit a "service invoked too many times" for sending Gmail, which is likely intended to prevent spam mail. However this is not spam and the recipient gmails are consenting and limits are unhelpful here.
Is there any way to remove sending limits between consenting gmails?
You're probably hitting one of the Apps Script quotas. In my experience, Google is unlikely to make exceptions or raise Apps Script limits upon request.
Most of these quotas are per-account, so a workaround that you could try is to run the script from another account once the limit is reached.
Also, the limits of the Apps Script Gmail Service are more restrictive than the limits of the pure Gmail API REST calls or other API libraries, so another workaround could be to write the script in another language and use the API, or if you want to keep using Apps Script you can use REST calls rather than the Gmail service.
Even if you still hit the quotas with the Gmail API there are ways to request a quota increase, while there is no such process for Apps Script. My guess is that Apps Script is intended for smaller projects, but if you're working with a larger volume you're supposed to use the Gmail API instead.
Quotas imposed based upon exceeding the rate not an absolute limit
It may be that you are looping to fast. Because google imposes limits based on an instantaneous rate. So assume you can send 2000 letters per day then that means you can send email every 0.023 second so it send one every 0.05 seconds you will probably stay out of trouble. By the way I don't really know what the quota is.

Service invoked too many times per day: email

I have this issue. My google account is G-Suite and I'm entitled to 1500 email recipients per day.
I have calculated the email that I have sent within a day and it adds up to only 221 recipients per day.
13 Recipients * 17 emails per day.
Is there any other issue that may caused this problem? Can it be the time between the execution runs? If so, is there any way to make a gap for each of the execution?
Are you CC'ing or BCC'ing anyone in your script? Gmail counts every CC or BCC as a separate email and thus it counts towards your email quota.
Please note the following part of the documentation:
Note: Newly created G Suite domains are subject to the consumer limit
for the first billing cycle if they have six or more users, or several
billing cycles if they have fewer users. For more information, see the
Help Center page on sending limits.
This would explain why you are temporarily limited to the Consumer quota.
Be also aware of different quota for external accounts.
As I constantly troubleshoot, I have found out that by using Google Groups, the problem went away. I believe the reason for it would be I am technically sending only one email to an address. That email address will then branch out and send to the different email that I have within that Google Group that I have created. After monitoring it for a few days, I do not have this problem anymore.
Thank you for those who have helped me.

Solution for Gmail Email Blast

Why: I'm a parent-teacher organization chairperson responsible for email communication to a community of 750 to 1,000. We switched to Gmail recently to save money.
What I do: I split my distribution list into groups of less than 250 people each. I write one email and then copy/paste the contents into multiple others. I place my distribution groups into each email BCC line and click send on each of the multiple emails.
What I'd like to do: Write one email and send without exceeding the per-email limit. Perhaps a google script can help? I've been looking at mail merge scripts, but they seem to be built for one at a email send at a time. Any ideas are appreciated.
Use google groups. Will solve all your issues plus you will write a single email.
I think you can do it with a gmail admin account. If not buy a google spps domain for a single user and do it from there.

When does Google require re-authentication?

I am using a script that sends an email whenever a user submits a form. Since the script is using my Google account to send the emails, I have to authorize it and that makes sense. However, my scripts eventually stop working (seemingly)randomly and requires re-authentication. The most recent occurrence happened today, one of my scripts requires authentication even though it states that the last edit happened 4 days ago.
Basically, I understand why I have to authenticate, but what makes me have to re-authenticate?
Scripts that use more sensitive apis like Gmail will force a reauth on every code change. Otherwise, you shouldn't need a reauth unless you use a new api, or if you start writing when in the past you were only reading (basically, if you do something beyond the scope of what was previously authorized).
Changes to the script will require you to re-authorize. And something as simple as adding a space to your code counts as a change. Many times these are inadvertent.

Google script quota

I am running an online free computer science education course website. I use Google scripts to evaluate the student quizzes (I use the MCQ script). Yesterday, there was a spike in visitors to my site. I noticed that the quiz scoring script is no longer sending results to students. I checked the failure notification, and it says "Service invoked too many times for one day:"
Is it because of a quota? If there is a quota, then is there any way to increase it?
My class has more than 800 students, so it is likely that they will submit their homework on the very day I post it online. So, I badly need to increase the email quota. If there is any workaround, that will also be very useful to know.
Thanks in advance.
If you deploy the app to run as the user executing, not as you, then it will run with their quota. However, they will have to click to authorize sending mail, and it will appear to have come from their own account to themselves.
The quotas are shown on the dashboard that can be also accessed through a link in the side panel of the documentation page. I'm afraid you hit quotas for email service.
...
EDIT : Ah, didn't see Corey's answer... smart suggestion of course ;-)
Try using an external API (i.e. Mandrill). Mandrill (it's by Mailchimp, so it's pretty robust) has an easy external API with much larger limits (in the order of thousands).
You can even set the from address so that it wouldn't look spammy (or, really, any different than the normal Google Apps Script send email).
Take a look at Use Mandrill API in Google Apps Script.