MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

COUNTING unread emails



  • Hi all - wondering if anyone knows of a fast way to just display the number of UNREAD emails for various accounts? EG:
    joe@public.com 2 unread emails
    suzieQ@person.net 3 unread emails
    (I wear too many hats, and this would be a nice thing to see in the morning)

    Thanks,
    K


  • Module Developer

    Good idea for a module.
    A first idea looking at this module
    https://github.com/MMPieps/MMM-Mail.
    In the node_helper.js you can find an idea how emails are fetched.
    There is a variable in client.search function:

    console.log("%s Mails fetched",Result.length);
    

    Result.length is the variable you’re looking for.
    So maybe you could use this module and rework it to just show the number of mails and not the mails themselves.



  • @lavolp3 THAT made my head hurt. Schoene Idee, aber ich kann kein whatever-that-language is. I’d be willing to learn, though, so I’ll start reading up on modules.

    K


  • Module Developer

    @amanzimdwini so, I played around a bit since I thought it would be a good idea as well.

    I found two mail modules, MMM-Mail by @Pieps and one called email. I can’t get the email module to work, but this one has support for multiple accounts, so that’s unfortunate.

    With the MMM-Mail one, I have forked it and created a branch. Unfortunately it currently only supports one account as far as I can see. Try it out and let me know what you think.
    https://github.com/lavolp3/MMM-Mail

    Clone it by putting in

    git clone https://github.com/lavolp3/MMM-Mail
    

    I still have some issues with the module itself (giving me popup messages far too often and failing to connect with the mail account too often, but if this works I’ll make a PR for the original module


Log in to reply