BASIC STEPS
- forward emails from zmail to gmail account (with filters)
- when they arrive in gmail – "label" them so they organize themselves into groups
- use "google app scripts" to automatically create calendar events from labeled emails
- set it to create calendar events whenever the "label" (group) has a new email in it
(just be sure that you are in the same google account for all steps – sometimes it is easier to logout of all of them and just be logged into the one we are working on)
Strain out spam – set up important emails as a calendar event in google calendar
Forward emails to a gmail account (using filters)
If you only forward the actual work messages and leave the spam – it will make it that much easier in the gmail account to see what's what.
- Create Filters to catch actual emails (and leave the spam behind)
Use a "*"to mean "anything" – so tim@*.com would cover – time@cubik.com, tim@nakedsword.com, tim@falconstudios.com etc.
you can also use the filters to categorize these emails in zmail as well
Now that you are moving important emails to gmail – you will label them there
Use Gmail Filters to push events in to correct “Labels” in Gmail
Set Up Filters that push emails into "labels" in Gmail – they are basically just groups.
The gmail filters organize and label the emails as soon as they arrive in gmail. You can make as many labels / filters are you need / want.
Set up the filter to catch emails however you need to.
All of these settings are open as well – all that matters is that you give these particular message a "label" – you can make separate labels for each email – or send them all to the same one – either way works.
Just remember the name of the label – you will need it for next steps.
Next set up the calendars you want to populate with these emails / events
CALENDAR SETUP
Switch over to https://calendar.google.com – using same google accout as you just did for gmail.
For this step it is probably easiest to make a new calendar for each "zmail / gmail filter" you created – they will all display together on the actual calendar. But doing them separately makes it easier to organize or even turn one off you need to.
- hit the "+" by the "other calendars" heading and make a new calendar – perhaps with the same name as the filter – or whatever name makes sense to you
Then once it is created – click 3 dots – and got to the settings for that calendar
then get calendarID
Use a simple “Google Apps Script” to create a calendar event out any new item that appears in the “labels”
Google Apps Scripts
this script is what will grab the emails out of the “labels” and make a calendar event out of them. It is fairly basic but does more the info into the calendar for you.
then go to https://www.google.com/script/start/ – just make sure you are using the same google account you were in gmail, and calendar with – only this time in apps scripts. You will also need to allow popups – usually you can see the option in the browser bar once one tries to launch – just click it and say "popups ok" from apps.google.com.
-
Hit "start scripting"
-
then "NEW PROJECT"
-
Name your project
-
Copy/paste the script below into the project pane
function createCalendarEventForLabeledEmails() { var labelName = "NSJira"; // Replace with your label name var calendarId = "c_e8c4b871ac9ee31a7b1e54f39fbe0bd363c5744784a1075328a446754aa982d1@group.calendar.google.com"; // Replace with your calendar ID // Get the label and threads var label = GmailApp.getUserLabelByName(labelName); if (!label) { Logger.log("Label not found."); return; } var threads = label.getThreads(); // Check if there are any threads if (threads.length == 0) { Logger.log("No emails found with this label."); return; } // Loop through each thread for (var i = 0; i < threads.length; i++) { var thread = threads[i]; var messages = thread.getMessages(); var message = messages[messages.length - 1]; // Get the last message in the thread var subject = message.getSubject(); var body = message.getPlainBody(); var sender = message.getFrom(); var date = message.getDate(); // Create a calendar event var calendar = CalendarApp.getCalendarById(calendarId); calendar.createEvent(subject, date, new Date(date.getTime() + 60 * 60 * 1000), {description: body + "\n\nFrom: " + sender}); // Remove the label from the processed thread thread.removeLabel(label); } }
-
once it's in – add the label and calendarID – this is the only info that you need to update
- gmail label
- calendarID
- then you have to give it a "trigger"
- Popups have to be allowed (it will give you a warining if they are not and a chance to allow them)
- just hit "allow"
- Click into one you want to run / try
- Click "Run" and the script will run on your inbox – making events for any older emails you have:
Running the “Apps Script” on your current labels will move any events in them into your calendar. Then moving forward – the “trigger will automatically create new events when there is a new email in the “label”.