1 42 package net.jforum.util.mail; 43 44 import java.util.ArrayList ; 45 import java.util.List ; 46 47 import net.jforum.entities.User; 48 import net.jforum.util.preferences.ConfigKeys; 49 import net.jforum.util.preferences.SystemGlobals; 50 import net.jforum.view.forum.common.ViewCommon; 51 import freemarker.template.SimpleHash; 52 53 57 public class ActivationKeySpammer extends Spammer 58 { 59 public ActivationKeySpammer(User u) 60 { 61 String forumLink = ViewCommon.getForumLink(); 63 64 String url = forumLink + "user/activateAccount/" + u.getActivationKey() 65 + "/" + u.getId() 66 + SystemGlobals.getValue(ConfigKeys.SERVLET_EXTENSION); 67 68 SimpleHash params = new SimpleHash(); 69 params.put("url", url); 70 params.put("user", u); 71 72 List recipients = new ArrayList (); 73 recipients.add(u.getEmail()); 74 75 super.prepareMessage(recipients, params, SystemGlobals.getValue(ConfigKeys.MAIL_ACTIVATION_KEY_SUBJECT), 76 SystemGlobals.getValue(ConfigKeys.MAIL_ACTIVATION_KEY_MESSAGE_FILE)); 77 } 78 } 79 | Popular Tags |