19 Google Apps Scripts for Pro Gmail Users

Google Apps Scripts help you do things on the Google’s platform that would otherwise be impossible without writing large chunks of code . It’s an easy, beginner-friendly, JS-like language that runs in the cloud and lets you code, script and automate Google services .

Gmail, though known as the one of the most powerful mail services, isn’t pain-free, especially for the power users, who would want to save attachments in Drive, schedule emails, batch delete emails etc.

Well, the good news is that now you can do all these and a lot more using Google Apps Scripts to ease your digi-life. Let’s take a look at these helpful scripts that Gmail users can benefit from.

Schedule emails to send in future

This script configure emails to auto-send them at a later point of time. The script uses your Gmail account (you@gmail.com) to send scheduled emails, hence you don’t lose your identity, and the recipient hardly knows that it’s sent by an automated script. Internally, it uses Gmail’s labels to mark the emails to be scheduled.

This script can help you in situations when you need to send a reminder to your team of an upcoming meeting or workshop, schedule greeting emails for birthdays or other events, etc. Moreover, you can schedule work emails for the time when you’d be offline or on vacation.

Snooze emails

This script helps you to answer your emails at your preferred time without having them all in your inbox all the time. The script, internally, archives snoozed emails for the time and makes them automatically reappear in your inbox as unread/new messages after the set duration. Personally, it sounds like the tool we were waiting for.

This script helps you manage and prioritize emails, especially if you receive them in large volumes, making email management as hard as fighting online privacy. Snoozing emails keeps away unnecessary mails till the time you want them hidden, hence a cleaner inbox.

Snooze emails in Gmail
Generate Inbox statistics report

Generates and shows a report featuring various metrics based on your email conversations. Though it’s similar to Google Account Activity, you can also extend this script to suit your requirements. The generated report includes statistics and graphs for the emails sent and received along with the top recipients and much more things.

This script keeps a record of your email account’s usage and helps you to understand or improve your email activities per your work requirements. Moreover, it also auto-sends an email to you with the attached reportbarworks quite straight and automatic, as expected.

Generate Gmail's Statistics
Convert Gmail messages to PDF

This script auto-saves the PDF versions of your conversations in your Drive and can be extended to convert all your mails. The included examples show as how to convert starred or unread messages from inbox. However, the script does require some work if you wish to extend or configure it.

This script is most helpful for people who have thousands of emails (all important enough to keep a copy of), but wish to use a cleaner inbox. With the help of this script, they can move old or less-used mails to the Drive as PDFs.

Convert Emails to PDF
Mark archived messages as read

This script scans all the emails in your inbox every minute for archived yet unread messages (placed anywhere but inbox) and marks them read. You can also extend it to work on emails with custom labels only by replacing label:unread -label:inbox with label:CUSTOM-LABEL -label:inbox.

This script saves your time and relieves you from checking or re-visiting unwanted emailsbaryou can just archive them once to get rid of them easily. It’s most helpful for notification or reports emails like from banks, service operators, etc. that are important to keep yet don’t need you to check them.

Extract all email addresses

The script gets all the email addresses from all of your messages having a particular label in your Gmail inbox, thus helping you know who you contact. It can process large volumes of emails within seconds and can list the sender’s name and the first communication’s details with the sender.

The script helps you in getting all the email addresses from a specific label for sending meeting or party invitations to a group easily. Moreover, if you have multiple businesses and use labels to manage your inbox, you can quickly get emails of everyone related to one of your teams or businesses using this simple script.

Extract emails in a Sheet
Create time-based Gmail filters

This script extends on Gmail’s filter capabilities and moves, marks, labels or deletes your inbox messages automatically (yes, even if you’re not online) and helps prevent clogging your inbox. It filters messages based on given conditions and applies the configured rules on them.

It is useful in scenarios where you’re not happy with Gmail’s native filters and rules, and wish to have better control over incoming messages. For example, the script can be pretty helpful when you want to delete all meeting reminders automatically after they’re a week old.

Auto-clean your Gmail inbox

The script cleans bundles of junk emails (after a specified time) from your inbox, and thus helps minimize space usage. These junk mails may include newsletter subscriptions, advertisements or promotional messages, etc.

The script helps you exempt yourself from cleaning up your mailbox every now and then. Moreover, deleting only given-duration-old mails ensures you’ve already peeked through them and had side-kept the emails you require.

Clean your Inbox
Find unanswered emails

Finds out all the emails which didn’t get any replies from the time you sent the last message in any of that conversation(s). For its working, it creates and manages two labels, ‘No Response‘ for emails which have no reply and ‘Ignore No Response‘ for emails those don’t require any response.

The script benefits you by saving you from manually finding the emails for which you’re expecting a response . Moreover, the script works in-house, can be extended as per your needs, works on emails already sent, and has zero security risk as no third party is involved.

Find unanswered emails
Set advanced Gmail filters

Extends on Gmail’s native filters and helps you set up advanced filters, which are more customizable than Gmail’s filters. Mails having numerous attachments, a large number of receivers, etc., are probably spam but aren’t tracked in Gmail by default. Using a Google Sheet, this script helps you move or get rid of such emails by applying filters on them.

The script works automatically on schedule (almost every minute) and keeps tracking and filtering incoming mails according to your configuration. It’s most helpful for heavy users (bloggers, publishers, advertisers, marketers, etc.) who receive lots of emails per day that are hard to manage manually.

Set advanced Gmail filters
Do simple Mail Merge

Allows using Mail Merge with Gmail (that’s not possible otherwise) to send personalized emails to masses using the contact information in a Google Sheet. You can easily extend it to include more fields as per your needs and use those contact fields in your mail (as variables).

With no official support for Mail Merge in Gmail, this script proves quite handy for everyone, including marketers who regularly send formatted emails to a large number of people, say greeting mails, notifications, or proposal mails, etc. This script saves your time and makes you more productive.

Simple Mail Merge
Create a message digest

Creates a summary of your Gmail conversations by going through all your emails in the inbox using a search query (based on time and label). The script assembles all of them into a single email and sends the digest to the set email address, say to your manager, who seeks all conversations of the day.

If you wish to query or filter emails, change the query variable in this script according to your need. It’s especially beneficial for people having multiple accounts for personal, work, temporary, etc., and wish to receive a consolidated email for each of the accounts in their primary inbox.

Sort messages by size

Sorts your emails (including their attachments) by size (that’s not possible natively in Gmail) and shows them in a Google Sheet, along with their size and other basic details. This script connects to Gmail and computes the sizes of individual messages and lists them down for you. Please follow the instructions in the link to get this up and to run.

This script helps in filtering the bulky emails so that you can delete emails with big attachments to save storage, and is extremely helpful for the people who use the free edition of Gmail and wants to free up some space.

Sort emails by size
Search mails using Regex

Allows making complex searches using regular expressions in Gmail. The script searches all your emails to find matches and uses a Google Sheet to store and show all the successful results to you. If you’re unsure about Regex, don’t worry, you can learn Regex easily.

This script helps you in searching emails in the geek way, and saves your time by refraining you from checking out every mail to find the right one. Moreover, it’s more powerful than Gmail’s basic search functionality, as the latter doesn’t support Regex.

Advance Search using Regex
Batch delete emails

Allows deleting bulks of emails from your Gmail mailbox, which is otherwise not possible (you get an error if you try to do it). Using this script, you can easily delete around 500 emails in one go, and it can also be triggered/scheduled to run automatically. Do replace the code label:inbox from:user@example.com (your email), as shown in the respective link.

This script helps you in situations when your inbox is almost full, and you need to delete lots of emails to fix space issues. Moreover, the code is also helpful at times when you wish to delete unnecessary emails like meeting invitations, news and newsletters, expired offers, coupons etc.

Set reminder in calendar

Creates an event reminder in your Google Calendar using any mail in your inbox. Using it, you can simply give any mail a particular label, and the mail would become a new reminder in your calendar. It makes it easy to keep track of important emails and also to set goals/schedules for yourself (say for event invites) more quickly than just using Gmail.

You can also set the reminder duration and calendar as per your preference. Don’t forget to change the calendarName, reminderLabel and reminderDuration in the script with your own information.

Send emails to Slack

Forwards emails to a Slack user or channel. This script searches through your Gmail inbox to look for the right emails and sends them to Slack using its webhooks. For it to work, create a Slack Webhook, and a label in your inbox. Then run this script using above given steps after replacing send-to-slack, payload variables and webhookUrl to correct values.

This helps in scenarios wherever you’d like to share particular emails directly with your team on Slack rather than mailing it to them. This script automates the whole task and also helps unclutter the work inboxes of your team members.

Auto-reply long emails

Archives and auto-responds to the lengthy emails. The script runs periodically and keeps an eye on new emails in Gmail. You can configure a custom mail and filter the mails for which the auto-reply should be posted. Please change the num_messages, work_limit, subj and body values per your own preference.

This helps you in dealing with very long messages, on which you can’t spend much time reading and also improves your overall productivity. Don’t forget to set a trigger for this script (read line 2 of the script).

Create RTM from Gmail threads

Creates a Remember the Milk (RTM) task for every mail labelled with ‘RTM’. It monitors your Gmail account for any ‘RTM’ labeled thread and sends a task-creation email to the RTM service. Do remember to change the LABEL_NAME, TARGET_EMAIL, RTM_LIST and RTM_TAGS values in this script per your needs/likes.

This script helps you in scenarios when you need reminders for meetings, important tasks, parties, etc. . that you would probably forget otherwise. Also, do note that you must have a Remember the Milk account to successfully use this script and create reminders.

Wrap up

That’s all, folks, about the various Google Apps Scripts that are freely available to use and can improve your regular tasks using Gmail and boost your productivity overall.

Did you find any of the above scripts useful for your work? Do you have any Gmail-related problems that you think can be solved using Google Apps Scripts? Let us know, and we’d try to help.