1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Sending notification emails with a little delay

Discussion in 'XenForo Suggestions' started by rellek, Jul 28, 2013.

  1. rellek

    rellek Well-Known Member


    I'd like to suggest a little feature. I think, it's a good idea to send notification emails a little bit delayed if the user who is supposed to receive it is online at the moment.

    So if you are online and involved in a discussion (or PC) and someone replies, you'd get a notification email about the new content. But if you are only anyway because you are waiting for a reply, you would not need that notification since you do have the alerts and you are online anyways.

    So that mails could be sent immediately if you are not online and if you are, they could be sent when your session timeout has been reached. Maybe a cron job could run every 15 minutes to check that.

    This would also save some server resources since emails tend to produce some load.
    PunKeel, Travis-Mc, footsie and 16 others like this.
  2. duderuud

    duderuud Active Member

    Sounds like a good idea...
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Personally I can't see the point in receiving delayed notifications for posts I have already responded to.

    I think most would find it confusing as to why they were receiving emails 30 minutes later for posts they had already read and replied to.
    Adam Howard likes this.
  4. rellek

    rellek Well-Known Member

    No that's not the point, @Brogan. I mean, when I'm online and I get that alert about you replying to my post, I don't need that email.

    So as long as I am online, there's no need to send that mail. If I read the thread (or maybe dismissed the alert), there is no need to send that mail at all.

    But if it turns out that I'm offline, the system should send me a mail after it recognized that I'm gone.
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Ah, your first post didn't make that clear.
    So you mean to prohibit the sending of notification emails when online.

    The only problem with that is the online timeout continues after someone has left the site unless they log out.
    So the system would assume they are still online when they aren't and therefore not send the email.
  6. rellek

    rellek Well-Known Member

    I thought, when you post a reply, the system would check if I'm still online (session table, lastclick + online timeout). If I'm still online, put that notification on hold. If not (last click too long ago or if I'm not even in the session table), the mail is sent immediately.

    Then, a cronjob would run every 15 minutes or so and does the same. It finds out that there's a mail on hold and checks if I'm still "online". If so, the mail continues to be on hold.

    And now, if I come back and read that thread and/or dismiss the alert, that "on hold" information is deleted and everything is fine.
    On the other hand, if it turns out that I'm offline (meaning, my lastclick was longer than online timeout minutes ago), the mail can be sent to me.
  7. Lemminator

    Lemminator Well-Known Member

    nice idea
  8. footsie

    footsie Member

    Great suggestion, hopefully this can be implemented in the future.

Share This Page