MacroDroid read incoming mail and send auto whatsapp message

RunoD

Member
Hi everyone,

I am looking for for a sollution for phone numbers in mail.

I would like that Macrodriod reads incoming outlook mail app and pic up the phone number in that mail and sends the user a automatic whatsapp massage.

Can someone help me with this?
 

Jacob L

Moderator (Lawsonator)
Trigger: notification > received > the app that you get emails from > contains > [0-9]+ > tick Regex.

Actions: Set variable > name the variable > … button > notification text.

Text manipulation action > extract > source put your variable name, text to match put [0-9]+, output variable back to the input variable

WhatsApp send action > variable.

That's a very basic solution - once it's made test and let me know. Maybe somebody else will have chipped in as well
 

RunoD

Member
Can u make a file like last time that i can import, i tried and it failed horribly im sorry to ask you again.
 

Jacob L

Moderator (Lawsonator)
Try this. You'll need to configure the notification received trigger to detect only your email app and configure the message in WhatsApp send action
 

Attachments

  • Email_to_WhatsApp.macro
    4.7 KB · Views: 21

RunoD

Member
Hi Jacob, I tested the code and it does not work, the other code you made (call whatsapp) does also not work if i turn both on. If i turn the email code off then the call whatsapp code works again.
 

Jacob L

Moderator (Lawsonator)
Hi Jacob, I tested the code and it does not work, the other code you made (call whatsapp) does also not work if i turn both on. If i turn the email code off then the call whatsapp code works again.
Did you make the changes I suggested to the above macro? I'm not sure why they would both fail
 

RunoD

Member
What do u mean with changes?

Yes i made the changes, i just double checked it takes a while to outlook sync so i have to wait like 15 minutes before a notification pops up.

But it did pop up and nothing happend.
 

Attachments

  • WhatsApp Image 2024-11-10 at 23.46.39.jpeg
    WhatsApp Image 2024-11-10 at 23.46.39.jpeg
    111.9 KB · Views: 14
  • WhatsApp Image 2024-11-10 at 23.46.49.jpeg
    WhatsApp Image 2024-11-10 at 23.46.49.jpeg
    131.8 KB · Views: 14
  • WhatsApp Image 2024-11-10 at 23.49.09.jpeg
    WhatsApp Image 2024-11-10 at 23.49.09.jpeg
    100.7 KB · Views: 14

Jacob L

Moderator (Lawsonator)
Macros that use WhatsApp send action need the device to be unlocked and screen on. Can you tell me if it's still not working and what you mean by this? It worked for me but I'm not using outlook
 

RunoD

Member
Hi Jacob,

I am using always screen on - app, my phone never sleeps, I mean with not working that the notification comes, and 3 secons later it dissepears go's up and gone. But nothing happends the app does not switch outlook automaticly like the other macro you made so like really nothing happends.

I have always Macro on the screen, the app, nothing els so that macro works with the other one you made and while macro app is always on phone notifications and mail comes from time to time all phone notifications macro handles it with whatsapp but the outlook mail notifications nothing happends.

What app are u using that it works on? and the printscreen above the settings are correct in those printscreens?
 

Jacob L

Moderator (Lawsonator)
Is it triggering? You'll know this by heading to the macro edit screen > three dots button at the top right > show log.

I don't know why notifications are disappearing as they shouldn't be, it does look like you configured everything correctly
 

RunoD

Member
Hi Jacob,

Here is the log, its in dutch let me know if you want it in english (you can also use google translate on words. (What app are you using for mail?)
 

Attachments

  • WhatsApp Image 2024-11-11 at 12.38.12.jpeg
    WhatsApp Image 2024-11-11 at 12.38.12.jpeg
    304.8 KB · Views: 8

Jacob L

Moderator (Lawsonator)
That's embarrassing, I made a mistake! You see the action that says set variable, is darker than everything else, if you click it and click enable - it should work. I am not specifically using an app to test it with. I think there may also be a bug with MacroDroid but I'm not sure, it looks from the log that the macro is cancelling itself after each fire. Can you tell me what version of MacroDroid you have? 5.48.13 should be out now
 

RunoD

Member
Hi Jacob,

I just checked and turn it on, after that i tested it out and its still not working. The notification of outlooks pops up and pops back but no massage from whatsapp on the number that is in that email just macro app screen still.

How emails looks like check 3th printscreen. Phone number begins with 06 instead of +31 634257718 (example)

P.s if I do test macro on call - Auto whatsapp what you made first, the app switches from macro to whatsapp, if i test this new one nothing happends its still in the macro app.
 

Attachments

  • WhatsApp Image 2024-11-11 at 13.16.43.jpeg
    WhatsApp Image 2024-11-11 at 13.16.43.jpeg
    89.9 KB · Views: 9
  • WhatsApp Image 2024-11-11 at 13.16.57.jpeg
    WhatsApp Image 2024-11-11 at 13.16.57.jpeg
    112.4 KB · Views: 10
Last edited:

Jacob L

Moderator (Lawsonator)
Ah I see now. WhatsApp needs an international phone number which usually starts with +, which your example does not include. This leaves the variable empty so the WhatsApp send action never works. I'll have a look later and see what I can do
 

Jacob L

Moderator (Lawsonator)
Hi Jacob what i see from the other macro you made, calling - whatsapp message. The massage is send to whatsapp contact but it does not click on send it just says in the text bar. Normaly since the beginning it sends the message to whatsapp, then sends it, and then closes whatsapp and goes back to macro app. Now it does not send the massage to the contact i have to press manually.

I dont know why that macro is having issues now.
The log tells you there's an issue, it suggests rebooting and it should fix. I'll look at the other macro in a moment
 

Jacob L

Moderator (Lawsonator)
If you click the WhatsApp send action and click configure > untick exit WhatsApp and press ok. Run the macro again and see if it keeps WhatsApp open with the message.

The way to test the macro is to disable the set variable action at the top and put the number in the variable manually and press the trigger > test trigger - see what happens
 

RunoD

Member
If you click the WhatsApp send action and click configure > untick exit WhatsApp and press ok. Run the macro again and see if it keeps WhatsApp open with the message.

The way to test the macro is to disable the set variable action at the top and put the number in the variable manually and press the trigger > test trigger - see what happens
Hi Jacob, this is for the calling or the mail macro? (cause the calling macro is fixed it works again the mail macro dont work still)

I put this on the mail macro and it did nothing, i will try to upload a screenshot video here
 
Top