use of net.jforum.util.mail.ForumNewTopicSpammer in project jforum2 by rafaelsteil.
the class ForumCommon method notifyUsers.
/**
* Sends a "new topic" notification message to all users watching the forum.
*
* @param f The Forum changed
* @param t The new topic
* @param post the newly created message
*/
public static void notifyUsers(Forum f, Topic t, Post post) {
if (SystemGlobals.getBoolValue(ConfigKeys.MAIL_NOTIFY_ANSWERS)) {
try {
ForumDAO dao = DataAccessDriver.getInstance().newForumDAO();
List usersToNotify = dao.notifyUsers(f);
// subscribed to the topic
if (usersToNotify != null && usersToNotify.size() > 0) {
Executor.execute(new EmailSenderTask(new ForumNewTopicSpammer(f, t, post, usersToNotify)));
}
} catch (Exception e) {
logger.warn("Error while sending notification emails: " + e);
}
}
}
Aggregations