Commit 96d412c4 by Tuomas Riihimäki

Add bill paid message to event properties from i18n

1 parent 442106c4
package fi.codecrew.moya.beans;
import java.io.OutputStream;
import java.text.MessageFormat;
import java.util.Calendar;
import java.util.Collection;
import java.util.List;
......@@ -17,26 +18,21 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import fi.codecrew.moya.beanutil.PdfPrinter;
import fi.codecrew.moya.facade.BillFacade;
import fi.codecrew.moya.facade.BillLineFacade;
import fi.codecrew.moya.facade.EventUserFacade;
import fi.codecrew.moya.beans.BillBeanLocal;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.LoggingBeanLocal;
import fi.codecrew.moya.beans.PermissionBeanLocal;
import fi.codecrew.moya.beans.SecurityLogType;
import fi.codecrew.moya.bortal.views.BillSummary;
import fi.codecrew.moya.enums.apps.BillPermission;
import fi.codecrew.moya.enums.apps.SpecialPermission;
import fi.codecrew.moya.facade.BillFacade;
import fi.codecrew.moya.facade.BillLineFacade;
import fi.codecrew.moya.facade.EventUserFacade;
import fi.codecrew.moya.model.AccountEvent;
import fi.codecrew.moya.model.Bill;
import fi.codecrew.moya.model.BillLine;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.LanEvent;
import fi.codecrew.moya.model.LanEventPropertyKey;
import fi.codecrew.moya.model.Product;
import fi.codecrew.moya.model.ProductFlag;
import fi.codecrew.moya.util.MailMessage;
import fi.codecrew.moya.utilities.I18n;
/**
* Session Bean implementation class BillBean
......@@ -255,8 +251,11 @@ public class BillBean implements BillBeanLocal {
}
MailMessage msg = new MailMessage();
msg.setSubject(I18n.get("bill.billMarkedPaidMail.subject", user.getEvent().getName()));
msg.setMessage(I18n.get("bill.billMarkedPaidMail.message", (bill.getBillNumber() == null) ? "----" : bill.getBillNumber().toString()));
String subject = MessageFormat.format(eventbean.getPropertyString(LanEventPropertyKey.BILL_PAID_MAIL_SUBJECT), user.getEvent().getName());
String content = MessageFormat.format(eventbean.getPropertyString(LanEventPropertyKey.BILL_PAID_MAIL_CONTENT), (bill.getBillNumber() == null) ? "----" : bill.getBillNumber().toString());
msg.setSubject(subject);
msg.setMessage(content);
msg.setTo(bill.getUser().getUser());
utilbean.sendMail(msg);
eventUserFacade.flush();
......
......@@ -4,8 +4,11 @@ public enum LanEventPropertyKey {
EVENT_LOGO(Type.DATA, null),
INVITEMAIL_SUBJECT(Type.TEXT, "Invitation to Moya Online Youth Accumulator"),
INVITEMAIL_CONTENT(Type.TEXT, "You have been invited to an event by {1}.\n\nYou can register to intranet at: {0}\n\nAfter registering to the intranet you can buy a ticket to Stream demoparty reduced price and invite your friends to join the party with you. More information can be found in the intranet. Remember also to visit our website at http://www.streamparty.org and join us at #streamparty in IRCNet. If you have any questions about this mail, registering to intranet, or anything else regarding Stream demoparty, please send us email to info@streamparty.org\n\n-- \nStream organizing\ninfo@streamparty.org"),
BILL_PAID_MAIL_SUBJECT(Type.TEXT, "[{0}] Lasku merkitty maksetuksi"),
BILL_PAID_MAIL_CONTENT(Type.TEXT, "Laskusi numero {0} on merkitty maksetuksi. Voit nyt siirtyä lippukauppaan varamaan haluamasi paikat. Tervetuloa tapahtumaan!"),
PORTAL_EMAIL_ADDRESS(Type.TEXT, "moya@codecrew.fi"),
PORTAL_EMAIL_NAME(Type.TEXT, "Moya Online Youth Accumulator"),
ADMIN_MAIL(Type.TEXT, "moya@codecrew.fi"),
EVENT_LAYOUT(Type.TEXT, "template1"),
SHOP_DEFAULT_CASH(Type.BOOL, null),
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!