MailTask.java

  1. package no.nav.data.common.mail;

  2. import lombok.AllArgsConstructor;
  3. import lombok.Builder;
  4. import lombok.Data;
  5. import lombok.NoArgsConstructor;
  6. import lombok.With;
  7. import no.nav.data.common.security.azure.support.MailLog;
  8. import no.nav.data.common.storage.domain.ChangeStamp;
  9. import no.nav.data.common.storage.domain.DomainObject;
  10. import no.nav.data.team.contact.domain.Channel;

  11. import java.util.UUID;

  12. @Data
  13. @Builder
  14. @With
  15. @AllArgsConstructor
  16. @NoArgsConstructor
  17. public class MailTask implements DomainObject {

  18.     private UUID id;

  19.     private String to;
  20.     private String subject;
  21.     private String body;

  22.     private ChangeStamp changeStamp;

  23.     public MailLog toMailLog() {
  24.         return MailLog.builder().to(to).subject(subject).body(body).channel(Channel.EPOST).build();
  25.     }
  26. }