1 43 package net.jforum.util.mail; 44 45 import java.util.ArrayList ; 46 import java.util.List ; 47 48 import net.jforum.entities.User; 49 import net.jforum.util.preferences.ConfigKeys; 50 import net.jforum.util.preferences.SystemGlobals; 51 import net.jforum.view.forum.common.ViewCommon; 52 import freemarker.template.SimpleHash; 53 54 58 public class PrivateMessageSpammer extends Spammer 59 { 60 public PrivateMessageSpammer(User user) 61 { 62 if (user.getEmail() == null || user.getEmail().trim().equals("")) { 63 return; 64 } 65 66 String forumLink = ViewCommon.getForumLink(); 67 68 forumLink += "pm/inbox" + SystemGlobals.getValue(ConfigKeys.SERVLET_EXTENSION); 69 70 SimpleHash params = new SimpleHash(); 71 params.put("path", forumLink); 72 params.put("user", user); 73 74 List recipients = new ArrayList (); 75 recipients.add(user.getEmail()); 76 77 super.prepareMessage(recipients, params, 78 SystemGlobals.getValue(ConfigKeys.MAIL_NEW_PM_SUBJECT), 79 SystemGlobals.getValue(ConfigKeys.MAIL_NEW_PM_MESSAGE_FILE)); 80 } 81 } 82 | Popular Tags |