With the recent Oreo operating system upgrade for Android, Gmail has removed the functionality that allowed custom notifications to be assigned by label for income emails. For example, if you received an email from your boss, you could set up a filter in Gmail that would assign a label to those emails, and then using that label you could have your phone play a custom Notification sound alerting you to the fact that an email from your boss had been received. It was a very useful feature and it’s hard to understand why Google removed it.
However, using Tasker for Android, and a Tasker Plug-in called Notification Listener, this functionality can be restored. Here’s how.
Requirements:
First, you’ll need a Gmail account with custom label settings. If you are missing this functionality from an earlier version of Android’s OS, you probably already have label notifications set. If not, go into your Gmail settings, choose your account, Manage Labels, and choose the label you want a custom notification for. Make sure you sync this label or this process will not work. Check the boxes for Label notifications and Notify for every message.
An example using my custom label settings for a label called Google Calendar:
Next, you’ll need to download the Tasker app from the Google Play store. This app seems complicated if you are unfamiliar with its features. It is very powerful, so you may want to look through tutorials to figure out all its uses. For the purpose of this tutorial, you want to make sure Tasker has Permissions to just about everything it asks for – in particular, Device Admin permission.
You’ll also need a Tasker plug-in called Notification Listener. This is what will “listen” for an incoming Gmail label notification and allow you to set a custom sound to alert you.
Both Tasker and Notification Listener come with nominal fees. I believe I paid less than $5.00 altogether, which was worth it to have this feature restored.
Using Tasker to Set Up a Profile
Once Tasker and Notification Listener are installed and permissions are set, you are ready to begin setting up a Profile in Tasker to handle the Gmail Label notifications. Tasker uses Profiles to watch for something to do, and Tasks to do that something. We’ll take them in order, beginning with Profiles.
1. Open Tasker. If you have no Profiles created yet, this screen will be blank. This screenshot shows the various Profiles I am using. Click the Plus Sign on the bottom right of the screen to start a new Profile. Don’t worry about naming it – you can do that later.
2. Choose Event as the type of Profile you are creating.
3. Choose Plugin as the Event Category.
4. Choose Notification Listener as the Event Plugin. After you choose it, it may bring up a sub-category that also says Notification Listener – if so, choose the top one.
5. At the Configuration page, choose the pencil icon to enter Configuration of the Profile.
6. In the Configuration Page, use the App Selector (rows of 9 dots next to Apps) to select Gmail. MAKE SURE TO CLICK THE CHECKMARK TO SAVE YOUR ENTRY. Alternately, you can enter com.google.android.gm in the Apps line.
When finished, tap the checkmark at the top of the screen to save your changes.
7. You will then be brought back to the Configuration screen which is now populated with variables pertaining to the app (Gmail) that you chose during the Configuration process. You can largely ignore all of that. The important thing is to now Click the Back Arrow at the top of the page (next to Event Edit) to exit the Profile Configuration.
Using Tasker to Set Up a Task
1. As soon as you hit the Back Arrow in the last step, Tasker should have brought up a screen for you to begin setting up your Task. Click New Task (+) to begin configuring a new task. Name the task in the window that pops up if you wish, and click the checkmark to save.
2. Next, click the Plus Sign to add an Action. Select Media as the Action Category.
3. Choose Play Ringtone under Select Media Action.
4. You are now at the Action Configuration Screen. First, since you want the alert played on an incoming email to be a Notification, you need to Change the Type of media played from Alarm (the default) to Notification, or Ringtone if you’d prefer, using the drop-down arrow.
Next, assign a Sound to be played. The easiest way to do this is to use the Search button (magnifying glass) to locate the sound you want to use on your device. It will populate in the line under Sound.
Finally, you have to tell the Action which label to listen for. You do this with the IF command in the configuration screen.
Tap the Plus Sign next to IF.
The variable to enter is %nlsubtext ~ [Label name] where [Label name] is the name of your label WITHOUT the brackets. NOTE: The Label Name must match your Gmail Label in spelling, punctuation, capitalization, etc.
Here is a screenshot of a completed configuration page using my label called Google Calendar.
5. You’re almost done! Hit the Back Arrow at the top of the screen next to Action Edit, then hit the Back Arrow at the top of the screen next to Task Edit, to return to the Profile page. You should now have a working Profile and associated Action to handle your incoming label notifications in Gmail.
If you want to name your Profile or Task, long-press the Profile in the Profiles tab, or the Task in the Tasks tab, and then Press the A at the top of the screen to enter a name in the field provided.