Advertisement
Guest User

Untitled

a guest
Feb 8th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.31 KB | None | 0 0
  1. package pt.sibs.is.monitoring.email;
  2.  
  3. import pt.sibs.is.monitoring.database.model.Type;
  4.  
  5. import java.text.MessageFormat;
  6. import java.time.LocalDateTime;
  7.  
  8. /**
  9.  * TODO: Documentation
  10.  *
  11.  * @author daniel.pinto
  12.  * @version 1.12.02
  13.  * @since 07-02-2017
  14.  */
  15. public class WelcomeNotification implements Notification {
  16.  
  17.     private String username;
  18.     private String email;
  19.     private Type type;
  20.     private String password;
  21.     private LocalDateTime creationDate;
  22.  
  23.     public WelcomeNotification(final String username, final String password, final String email, final Type type, final LocalDateTime creationDate) {
  24.         this.username = username;
  25.         this.password = password;
  26.         this.email = email;
  27.         this.type = type;
  28.         this.creationDate = creationDate;
  29.     }
  30.  
  31.     @Override
  32.     public String getRecipient() {
  33.         return MessageFormat.format(getProperties().getProperty("recipient"), email);
  34.     }
  35.  
  36.     @Override
  37.     public String getSubject() {
  38.         return getProperties().getProperty("subject");
  39.     }
  40.  
  41.     @Override
  42.     public String getBody() {
  43.         return MessageFormat.format(getProperties().getProperty("body"), username, type, email, password, creationDate, URL);
  44.     }
  45.  
  46.     @Override
  47.     public String getName() {
  48.         return "welcome";
  49.     }
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement