Open email on notification receipt

Ubername

New member
Hi. I regularly get emails which have a title like"Uber, we have news for you". I can see the title in the notification, but the interesting stuff is in the email body. Is there a way to use MacroDroid (or any other way for that matter"!) to open the email when I get the notification? I can set the trigger using the notification type trigger and the email client as the app, but I do not see how to create an action to open the specific email. I have created an action to open the email client from the macro, but that is not that much more useful than clicking on the notification. Thanks in advance.
 

Ubername

New member
Thanks! Eventually got it solved, but it took some doing! The problem was that the Oneplus 7T (Android 12, Oxygen12) notification access permission is hidden far away in the settings. (Apps - Special app access - Device & app notifications)According to some other troubleshooting I read, it needed to be switched off and on again. I also had to remove wildcard * from the 'contains' text. It seems to look specifically for the * rather than treating it as a wildcard. All good for now though.
 

Ubername

New member
I received this in my log when enabling regex :
------------------+++++++-----------------

2024-07-20 12:47:28.491 - Error with regex, you may need to escape a special character (for example if matching the + character then you should write \+) : java.util.regex.PatternSyntaxException: Syntax error in regexp pattern near index 5

(?s)*trois*

----------------------------+++++------------------
It's not a huge problem, but it's at odds with the text on the page where you set the matching condition. On another note, what is the easiest way of taking an extract from the system log? I ended up having to share it via email, read the email, extract the file to my gdrive them read/edit it from there. Surely one should just be able to cut and paste from the log?
 

md_sgf

Well-known member
On another note, what is the easiest way of taking an extract from the system log? I ended up having to share it via email, read the email, extract the file to my gdrive them read/edit it from there. Surely one should just be able to cut and paste from the log?
Share to a file explorer app (eg Total Commander).
Or take screenshot, tap "[T]" button (OCR), copy required text. If your phone has it.
 

Ubername

New member
Share to a file explorer app (eg Total Commander).
Or take screenshot, tap "[T]" button (OCR), copy required text. If your phone has it.
Thanks! I should have looked harder. My file explorer (cx file Explorer) was on the third page of the "share with..."apps. I still haven't worked out how to control which apps Android suggests I might want to "share with".
 

md_sgf

Well-known member
I still haven't worked out how to control which apps Android suggests I might want to "share with"
After about Android 10, the OS doesn't like users/apps being able to this, for some unknown reason that only they know :mad:

I used to use Sharedr on my Android 10 phone, but for some reason that doesn't work now. I think the Android OS doesn't allow that app to work now.

On Android 11 or so up, you can at least add favourites to share menu.
 
Last edited:

Ubername

New member
After about Android 10, the OS doesn't like users/apps being able to this, for some unknown reason that only they know :mad:

I used to use Sharedr on my Android 10 phone, but for some reason that doesn't work now. I think the Android OS doesn't allow that app to work now.

On Android 11 or so, you can at least add favourites to share menu.
Thanks! The tip about pinning favorites in share menu is great (I , like you, can't understand why removing functionality is seen as progress). My macro works as well as I think it is going to. I get all the logs I have set up saying it has been triggered and that it has performed the action (click content), but whether I actually get to see the email opened seems to be hit or miss. I think it has to be the last thing opened before I unlock the screen, and if I am using the phone I guess it opens it then closes it because I am using the phone for something else. All a bit weird. It is an interesting challenge, and I am surprised there are not more people wanting to interrogate the content of a received email with macrodroid. I find lots of examples of how to send emails using macrodroid, but very few about how to handle their receipt. So much so that this thread was the top of one of my searches!
 

Ubername

New member
I seem to have diagnosed the intermittent nature of the behaviour even if I haven't found a solution yet. From time to time the 'accessibility 'permission' (I am not sure it is technically a permission) reports that Macrodroid is no longer working. (I can not remember the exact words and can not recreate them.) When this happens I need to re-enable the accessibility 'permission' and restart the phone. Then it works until the next time the permission disappears. N.B. I may have this wrong, as nothing appears in my Macriodroid log to say the permission is missing.
 

md_sgf

Well-known member
So it isn't that one of macrodroid's accessibility services that regularly stops?
If it is, you should be able to restart it using Action: Accessibility Service.

Or is it (eg) Notifications permission that keeps getting disabled??

Next time it happens, check App info page to see if permissions are still allowed.
And Accessibility..Installed apps page in Settings.
 
Last edited:
Top