Android - How can I disable notification for a specific gmail account during certain hours?
Toggling the syncing of Gmail for the account is the best option. Turning of Gmail sync on a Google account in Android does not prevent you from fetching mail for that account via a method such as "pull to refresh" when you are viewing that account in the Gmail app.
I use Synker to integrate with Tasker, though I know there are other apps that expose Tasker control of specific sync settings on an account by account basis.
The basic outline I have is as follows:
- A profile named "Work" whose conditions are a combination of a time, 9am-5pm, and a Date, Mon-Fri. It has the same entry and exit task.
- A task named "Work" that has two items: one to set the sync options of my work Google account to have Gmail sync on that is conditional on
if %PACTIVE ~ *Work*
, one to set the sync options of my work Google account to /not/ sync Gmailif %PACTIVE !~ *Work*
If I want to read work email when sync is not on for that account, I just open Gmail, switch to that account, and swipe down ("pull to refresh"), fetching the messages from the server.
Try the app Quiet for Gmail from here https://play.google.com/store/apps/details?id=com.sgarcia.quiet_for_gmail
It toggles the sync of your email accounts on a schedule you can define. In addition to that, you can also override your schedule for special occasions, like a bank holiday.