16,7 → 16,7 |
|
public abstract class Messages |
{ |
public static final String HOST = "26th.net"; |
public static final String HOST = "localhost"; |
public static final String CHARSET = "windows-1251"; |
|
public static void send(String from, String to, String subject, String body) |
46,24 → 46,12 |
public static void sendRegistrationMessage(Participant participant, String ip) |
throws UserException |
{ |
prepareMail(participant, ip, "ak.kickup.core.mail.subject", "ak/kickup/core/RegistrationMail.txt"); |
} |
|
public static void sendRemindMessage(Participant participant, String ip) |
throws UserException |
{ |
prepareMail(participant, ip, "ak.kickup.core.remindmail.subject", "ak/kickup/core/RemindMail.txt"); |
} |
|
private static void prepareMail(Participant participant, String ip, String subjectKey, String messageFile) |
throws UserException |
{ |
String subject; |
StringBuffer message = new StringBuffer(); |
|
// get subject |
ResourceBundle res = ResourceBundle.getBundle("ak/kickup/core/CoreResources"); |
String subjectString = res.getString(subjectKey); |
String subjectString = res.getString("ak.kickup.core.mail.subject"); |
subject = MessageFormat.format(subjectString, |
new String[] { participant.getEvent().getName() } ); |
|
73,7 → 61,7 |
if(cl == null) cl = ClassLoader.getSystemClassLoader(); |
|
BufferedReader file = new BufferedReader(new InputStreamReader(cl.getResourceAsStream( |
messageFile), "UTF-8")); |
"ak/kickup/core/RegistrationMail.txt"), "UTF8")); |
char[] buf = new char[2048]; |
int bufLen; |
while((bufLen = file.read(buf)) >= 0) { |