Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Send email to all members when new discussion topic is created

Hi,

In our forum their are around 18000 members, and what i need is that when any user posts a new discussion than email notification should be sent to all members that new topic for discussion is created.

Does anybody know how to process such huge emails and so achieve this ?

Thanks,

Comments

  • R_JR_J Ex-Fanboy Munich Admin

    The theory is a queue:

    Create a "Tasks" table that holds tasks which must be done
    Hook into the AfterSaveDiscussion event and save a new task:

    Title: Inform users about new discussion
    Body: DiscussionID 123
    Status: Open
    

    Create an endpoint that can be called by a cron job which reads one open task and processes it depending on the content.

    If the tasks reads like the task above, split it into smaller parts:

    Title: Send mail to user because of new discussion
    Body: DiscussionID, UserID, UserName, UserMail
    Status: open
    

    The trick is to create one smaller task per user. And certainly you have to change the status of the first task!

    If the task reads like one of the already split tasks, jut do it: send one mail to one user, changed status to "done" or delete task.

    But this requires an external trigger. That should be a cron job.

    I have already written a queue plugin, but I'm not able to judge if it was already finished: https://github.com/r-j/simplequeue

Sign In or Register to comment.