Is it possible to make an app that notifies me with alarm sound when I get new mail from specicific email id?

I am using ecwid.com within mit app. ECWID is an ecommerce widget that can be used to sell products. So, when customers make new orders in my mit app using this widget/url, ECWID will send email to me. But, my intention is that I want to hear alarm sound for every new orders. So, can I create an alarm app that will sense new orders emailed by ECWID in my gmail, and give a continuous alarm sound until I stop.

App that is created: https://play.google.com/store/apps/details?id=appinventor.ai_quailtobuy.QCanteen

You will need an IMAP extension to read your incoming emails

Let me suggest you to get this first running in the foreground. Then to get it running in the background use the itoo extension.

Taifun

Il try it definitely in near future.

I am planning to create an app that rings continuously when a new email arrive from specific email id and when new emails arrive from other email ids I don’t want continuous ring.

That's a nice project... just do it... :muscle:
Taifun

1 Like

Sure, il do it. But, all the words in the blocks of these extensions are new to me. So, il take my own time.

thanks for sharing

1 Like

After reading about the first extension that is shared here by @Taifun, I guess that the same extension can detect/sense the specific email (in my case 'New Orders').

After reading the second extension, I guess that both the 1st & 2d extensions can sense/detect the email from specific email id that contain the words 'New Order Recieved'.

But, Now the question is how to attach continous alarm sound to notify new orders.

Update: Okay, I guess that the 3rd extension as said can do continous 'something' , so, it may give continous alarm sound as notification to new order.

No
In the NewMessageReceived event check the sender and if it is New Orders rhen play an alarm sound

Taifun

1 Like

I tried the other extension since it is free. What I have to do next?
blocks (7)t

Do I have to put all these blocks within 'Initialize Screen block.

you have to experiment yourself... I'm not familiar with that extension
see also some tips here

Taifun

Okay, Let me try.

I asked chatgpt about the possibility to achieve the same result by combining 'Notification Listener + TinyDB + Alarm'. Chat GPT gave me a big reply but I am sharing part of it. The below lines are given by chatgpt.

// When a new notification is received
Title = "New Order"
Message = "You have a new order!"
UniqueIdentifier = "Order123" // Unique identifier for the notification

// Store notification in TinyDB
TinyDB1.StoreValue("Notifications", UniqueIdentifier, Message)

// Display notification using Notifier
Notifier1.ShowNotification(Title, Message, "default")

// Check if the notification should trigger an alarm
If UniqueIdentifier = "Order123"
// Play alarm sound
Sound1.Play()
End If

THE COMPLETE CHATGPT REPLY IS GIVEN BELOW:

QUESTION:

How can I create an app using mit app inventor in such a way that the app will store the notifications in tinyDB and give alarm sound only to specific notification?

ANSWER:

To create an app in MIT App Inventor that stores notifications in TinyDB and plays an alarm sound only for specific notifications, you can follow these steps:

  1. Design the App UI:

    • Create the user interface with components like buttons, labels, a Notifier, and a Sound component.
  2. Add TinyDB Component:

    • Include the TinyDB component in your project, which will be used to store notifications.
  3. Implement Notification Handling:

    • When a new notification is received, add the notification details to TinyDB.
    • You can use TinyDB's StoreValue block to store information like notification title, message, or a unique identifier for the notification.
  4. Trigger Notification and Sound:

    • When displaying notifications, check if the notification meets the criteria for playing the alarm sound.
    • Use a conditional statement to determine whether to play the sound or not.
  5. Play Alarm Sound:

    • If the condition for playing the sound is met, use the Sound component to play the alarm sound.

Here's a simplified example in pseudocode:

// When a new notification is received
Title = "New Order"
Message = "You have a new order!"
UniqueIdentifier = "Order123"  // Unique identifier for the notification

// Store notification in TinyDB
TinyDB1.StoreValue("Notifications", UniqueIdentifier, Message)

// Display notification using Notifier
Notifier1.ShowNotification(Title, Message, "default")

// Check if the notification should trigger an alarm
If UniqueIdentifier = "Order123"
    // Play alarm sound
    Sound1.Play()
End If

Remember to adapt this pseudocode to your specific use case and logic. You may need to modify the conditions for playing the sound based on your notification criteria.

Test your app thoroughly to ensure that notifications are stored correctly in TinyDB, and the alarm sound is played only for the specified notifications.

If the question is incorrect, the answer will be incorrect, too...

This is what you asked earlier

make an app that notifies me with alarm sound when I get new mail from specicific email id

Taifun

Yes, that (1st question) was my actual goal. But, I am trying in different ways to see the same result.

The purpose is to hear continuous alarm sound when I get new order (new orders will be notified via email by ECWID but I want to hear continous alarm sound for that.)

Created something like this, but not working as intended. This one is giving alarm for all notifications. I want Alarm only for emails with the word 'ecwid' in it.

This one almost worked.
blocks (12)

Reference:

  1. https://www.youtube.com/watch?v=TUpLc_nTqLs&pp=ygUmbm90aWZpY2F0aW9uIGxpc3RlbmVyIG1pdCBhcHAgaW52ZW50b3I%3D

  2. https://www.youtube.com/watch?v=7eb6xy_nUBk

If there is better idea than this, share the idea here.

Okay, I think the next thing that I have to do is 'to work on background extension' as said by @Taifun earlier.

what about this?

https://ai2.appinventor.mit.edu/reference/blocks/text.html#contains

contains
Returns true if piece appears in text; otherwise, returns false.

Taifun

1 Like

Il learn more about it.