View Javadoc

1   /*
2    * Copyright (C) 2007 Alf Mikula
3    * 
4    * This file is part of PromoteGo.
5    *
6    * PromoteGo is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU General Public License as published by
8    * the Free Software Foundation, either version 3 of the License, or
9    * (at your option) any later version.
10   *
11   * PromoteGo is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU General Public License for more details.
15   *
16   * You should have received a copy of the GNU General Public License
17   * along with PromoteGo.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  package org.promotego.formbackingbeans;
20  
21  import org.promotego.beans.ScheduledGame;
22  import org.promotego.beans.User;
23  
24  /***
25   * @author alf
26   *
27   */
28  public class ScheduledGameMessageContext implements MailMessageContext
29  {
30      private String m_subject;
31      private String m_summary;
32      private String m_respondMessage;
33      
34      public ScheduledGameMessageContext(User sender, ScheduledGame scheduledGame, String baseUrl)
35      {
36          m_subject = "[PromoteGo] A message about your upcoming game with " + sender.getUsername();
37          m_summary = sender.getUsername() + " has sent you the following message about your scheduled game on "
38              + scheduledGame.getStartTime() + ".\nYou can view the scheduled game here: " + baseUrl
39              + "/showscheduledgame.do?scheduledGameId=" + scheduledGame.getId();
40          m_respondMessage = "If you wish to respond to this message, go to " + baseUrl
41              + "/sendmessage.do?recipientId=" + sender.getId() + "&scheduledGameId=" + scheduledGame.getId();
42      }
43  
44      public String getSubject()
45      {
46          return m_subject;
47      }
48  
49      public String getSummary()
50      {
51          return m_summary;
52      }
53  
54      public String getRespondMessage()
55      {
56          return m_respondMessage;
57      }
58  }