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 LostPasswordSpammer extends Spammer { 59 public LostPasswordSpammer(User user, String mailTitle) { 60 String forumLink = ViewCommon.getForumLink(); 61 62 String url = forumLink + "user/recoverPassword/" 63 + user.getActivationKey() 64 + SystemGlobals.getValue(ConfigKeys.SERVLET_EXTENSION); 65 SimpleHash params = new SimpleHash(); 66 params.put("url", url); 67 params.put("user", user); 68 69 List recipients = new ArrayList (); 70 recipients.add(user.getEmail()); 71 72 super.prepareMessage(recipients, params, 73 mailTitle, 74 SystemGlobals.getValue(ConfigKeys.MAIL_LOST_PASSWORD_MESSAGE_FILE)); 75 } 76 } | Popular Tags |