01: package ru.emdev.EmForge.email;
02:
03: import org.apache.commons.lang.StringUtils;
04:
05: /**
06: */
07: public class EmailImpl implements WritableEmail {
08: private static final long serialVersionUID = 3256721801273750323L;
09: private String toName;
10: private String fromName;
11: private String content;
12: private String subject;
13: private int priority;
14: private String carbonCopy;
15:
16: /**
17: *
18: */
19: public EmailImpl() {
20: priority = EmailSender.PRIORITY_NORMAL;
21: }
22:
23: public String getContent() {
24: return content;
25: }
26:
27: /**
28: * @param content
29: * The content to set.
30: */
31: public void setContent(String content) {
32: this .content = content;
33: }
34:
35: public String getFromName() {
36: return fromName;
37: }
38:
39: public void setFromName(String fromName) {
40: this .fromName = fromName;
41: }
42:
43: public String getSubject() {
44: return subject;
45: }
46:
47: public void setSubject(String subject) {
48: this .subject = subject;
49: }
50:
51: public String getToName() {
52: return toName;
53: }
54:
55: public void setToName(String toName) {
56: // Replace any ; as email separators with , which are allowed
57: toName = StringUtils.replace(toName, ";", ",");
58: this .toName = toName;
59: }
60:
61: public void setPriority(int priority) {
62: // if (! PopEmailer.isValidPriority(priority)) {
63: // throw new IllegalArgumentException("Invalid email priority");
64: // }
65:
66: this .priority = priority;
67: }
68:
69: public int getPriority() {
70: return this .priority;
71: }
72:
73: public String getCarbonCopy() {
74: return carbonCopy;
75: }
76:
77: public void setCarbonCopy(String carbonCopy) {
78: this .carbonCopy = carbonCopy;
79: }
80:
81: /**
82: * @note Currently not supported
83: */
84: public String getHtmlContent() {
85: return null;
86: }
87: }
|