Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 976 → Rev 977

/kickup/trunk/src/ak/kickup/core/mail/Messages.java
16,7 → 16,7
 
public abstract class Messages
{
public static final String HOST = "localhost";
public static final String HOST = "26th.net";
public static final String CHARSET = "windows-1251";
 
public static void send(String from, String to, String subject, String body)
46,12 → 46,24
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("ak.kickup.core.mail.subject");
String subjectString = res.getString(subjectKey);
subject = MessageFormat.format(subjectString,
new String[] { participant.getEvent().getName() } );
 
61,7 → 73,7
if(cl == null) cl = ClassLoader.getSystemClassLoader();
 
BufferedReader file = new BufferedReader(new InputStreamReader(cl.getResourceAsStream(
"ak/kickup/core/RegistrationMail.txt"), "UTF8"));
messageFile), "UTF-8"));
char[] buf = new char[2048];
int bufLen;
while((bufLen = file.read(buf)) >= 0) {