Author Topic: HDI ... access information about unread/new mails in tasker?  (Read 7086 times)

Ulrichsson

  • Newbie
  • *
  • Posts: 2
HDI ... access information about unread/new mails in tasker?
« on: August 20, 2014, 03:28:19 am »
Hi,

I'm a beginner in tasker and I find most tutorial somewhat confusing because they seem to use older versions. My eventual goal is to use send information about either the number of unread or new e-mails in aqua mail to the minimalistic text widget.

I managed to install the beta with the tasker event plugin, but I cannot find the information about available %aqm variables anywhere. Is there a list somewhere?

Any help would be highly appreciated!

Many thanks,
BJ

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: HDI ... access information about unread/new mails in tasker?
« Reply #1 on: August 22, 2014, 02:00:00 am »
For variables, Tasker has an IntelliSense-type thing (autocomplete?) which lists all the variables -- this is in the action editor, by action I mean what you assign to happen in Tasker (task?) based on AquaMail triggering an event.

I'm attaching the screenshots. There is no unread count though.

However:

For an unread count, you can just listed to these broadcasts:

   private static final String NOTIFICATION_BROADCAST_ACTION = "org.kman.AquaMail.accountNotification";
   private static final String STATE_CHANGE_BROADCAST_ACTION = "org.kman.AquaMail.stateChange";

Extras:

   private static final String EXTRA_ACCOUNT_ID = "accountId";
   private static final String EXTRA_UNREAD_COUNT = "unreadCount";
   private static final String EXTRA_HAS_NEW = "hasNew";
   private static final String EXTRA_IS_SMART_LIST = "isSmartList";
   private static final String EXTRA_IS_SILENT = "isSilent";

"accountId" is a long

When the user clears an account's notification, you'll get "unreadCount" = 0


Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

Ulrichsson

  • Newbie
  • *
  • Posts: 2
Re: HDI ... access information about unread/new mails in tasker?
« Reply #2 on: August 23, 2014, 01:13:26 am »
Many thanks!!!

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: HDI ... access information about unread/new mails in tasker?
« Reply #3 on: August 23, 2014, 10:56:14 pm »
Realized that I didn't attach any screenshots... Here they are, might be useful still.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

mabahj

  • Newbie
  • *
  • Posts: 40
Re: HDI ... access information about unread/new mails in tasker?
« Reply #4 on: September 08, 2014, 06:13:50 pm »
Two issues:
- I've noticed that the %unreadcount after receiving an email (accountNotification) is the actual unread count minus one? Is that a bug?
- %issilent is never populated. Not sure why. I don't really need it, but I would expect some value there.

And - for other Tasker users, it took some time for me to understand how to do actually this in Tasker, so here's some help to get you started:

1. Create a new profile. This profile will be triggered when you receive email. Choose "Event" and "System". Select "Intent Received".
2. As "Action", fill in "org.kman.AquaMail.accountNotification" (without quotes). Leave the other fields as they are.
3. Add a task. Just create a popup with text "%accountid, %unreadcount, %hasnew, %issmartlist, %issilent". (Notice lower case letters only.)
4. Create a new profile. This profile will be triggered when you mark email as read and unread in AquaMail. Choose "Event" and "System". Select "Intent Received".
5. As "Action", fill in "org.kman.AquaMail.stateChange" (without quotes). Leave the other fields as they are.
6. Use the task you previously added for simplicity.

Try to send yourself an email. You you should get some data to play.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: HDI ... access information about unread/new mails in tasker?
« Reply #5 on: September 13, 2014, 01:11:52 am »
%unreadcount -- not to my knowledge. It's the same value that goes into status bar notifications.

Are you using notifications about "new" or "all unread" messages?

%issilent -- only set when it's actually true, and this can happen when there are no actual new messages during this particular mail check, and the notification setting "only when new messages" is enabled.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

mabahj

  • Newbie
  • *
  • Posts: 40
Re: HDI ... access information about unread/new mails in tasker?
« Reply #6 on: September 15, 2014, 02:04:56 am »
Using "all unread" notification. But I figured it out. I assumed that the %unreadcount was for the smart folder, but it was for only the account that received the email. I had to keep track of the amount IDs and add the unread counts up to create my own "smart folder unread count"

Ben

  • Newbie
  • *
  • Posts: 3
Re: HDI ... access information about unread/new mails in tasker?
« Reply #7 on: October 04, 2016, 01:49:26 pm »
And - for other Tasker users, it took some time for me to understand how to do actually this in Tasker, so here's some help to get you started:

1. Create a new profile. This profile will be triggered when you receive email. Choose "Event" and "System". Select "Intent Received".
2. As "Action", fill in "org.kman.AquaMail.accountNotification" (without quotes). Leave the other fields as they are.
3. Add a task. Just create a popup with text "%accountid, %unreadcount, %hasnew, %issmartlist, %issilent". (Notice lower case letters only.)
4. Create a new profile. This profile will be triggered when you mark email as read and unread in AquaMail. Choose "Event" and "System". Select "Intent Received".
5. As "Action", fill in "org.kman.AquaMail.stateChange" (without quotes). Leave the other fields as they are.
6. Use the task you previously added for simplicity.
Has anything changed with the Aqua Mail broadcasts? I can get Tasker profiles to trigger on new emails with org.kman.AquaMail.accountNotification, but org.kman.AquaMail.stateChange never seems to trigger anything (I assume it should trigger if an email is marked as read?). I'm trying to make it so it keeps track of how many unread emails I have, and it will increment with new emails as it should, but doesn't update when they're read.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: HDI ... access information about unread/new mails in tasker?
« Reply #8 on: October 11, 2016, 01:09:09 am »
Re: org.kman.AquaMail.stateChange never seems to trigger anything (I assume it should trigger if an email is marked as read?)

Just stepped through the code -- yes this gets sent when you mark a message as read or unread in the app.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

Ben

  • Newbie
  • *
  • Posts: 3
Re: HDI ... access information about unread/new mails in tasker?
« Reply #9 on: October 11, 2016, 06:41:20 am »
Thanks for checking - what about if the email is marked as read on another device (eg. desktop computer), and the AquaMail sync runs and now realises the email is no longer unread? I'm looking for a way to make sure %unreadcount is kept up to date in this circumstance.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: HDI ... access information about unread/new mails in tasker?
« Reply #10 on: October 11, 2016, 10:33:44 pm »
A mail check triggers a org.kman.AquaMail.accountNotification but those are only sent if there are new messages or you'd turned off "notify only about new messages".

So this one may not help you, the logic (described above) is intended for third party notification apps, so it sort of matches the logic for status bar notifications.

Or maybe I should send them always?
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

Ben

  • Newbie
  • *
  • Posts: 3
Re: HDI ... access information about unread/new mails in tasker?
« Reply #12 on: October 12, 2016, 04:52:15 am »
Perfect, thank you!