1 <?php
2 /* --------------------------------------------------------------
3 EmailFactoryInterface.inc.php 2015-02-05 gm
4 Gambio GmbH
5 http://www.gambio.de
6 Copyright (c) 2015 Gambio GmbH
7 Released under the GNU General Public License (Version 2)
8 [http://www.gnu.org/licenses/gpl-2.0.html]
9 --------------------------------------------------------------
10 */
11
12 /**
13 * Interface EmailFactoryInterface
14 *
15 * @category System
16 * @package Email
17 * @subpackage Interfaces
18 */
19 interface EmailFactoryInterface
20 {
21 /**
22 * Creates an email object
23 *
24 * @param IdType $id (optional) E-Mail ID.
25 * @param EmailSubjectInterface $subject (optional) E-Mail subject.
26 * @param EmailContentInterface $contentPlain (optional) E-Mail plain content.
27 * @param EmailContentInterface $contentHtml (optional) E-Mail HTML content.
28 * @param bool $p_isPending (optional) E-Mail is pending?
29 * @param ContactCollectionInterface $contacts (optional) E-Mail contacts.
30 * @param AttachmentCollectionInterface $attachments (optional) E-Mail attachments.
31 *
32 * @return Email The created email.
33 */
34 public function createEmail(IdType $id = null,
35 EmailSubjectInterface $subject = null,
36 EmailContentInterface $contentHtml = null,
37 EmailContentInterface $contentPlain = null,
38 $p_isPending = true,
39 ContactCollectionInterface $contacts = null,
40 AttachmentCollectionInterface $attachments = null);
41
42
43 /**
44 * Creates an email contact object
45 *
46 * @param EmailAddressInterface $emailAddress Email address of the contact.
47 * @param ContactTypeInterface $contactType Contact type (see ContactType class definition).
48 * @param ContactNameInterface $contactName (optional) Contact display name.
49 *
50 * @return EmailContact The created email contact.
51 */
52 public function createContact(EmailAddressInterface $emailAddress,
53 ContactTypeInterface $contactType,
54 ContactNameInterface $contactName = null);
55
56
57 /**
58 * Creates an email attachment object
59 *
60 * @param AttachmentPathInterface $path Valid path of the attachment (on the server).
61 * @param AttachmentNameInterface $name (optional) Display name for the attachment.
62 *
63 * @return EmailAttachment The created email attachment.
64 */
65 public function createAttachment(AttachmentPathInterface $path, AttachmentNameInterface $name = null);
66
67
68 /**
69 * Creates a mailer adapter object
70 *
71 * @return MailerAdapter The created mailer adapter.
72 */
73 public function createMailerAdapter();
74
75
76 /**
77 * Creates a PHP mailer object.
78 *
79 * @param string $protocol (Optional) Provide 'smtp', 'sendmail' or 'mail' if you want to override the
80 * EMAIL_TRANSPORT constant.
81 *
82 * @return PHPMailer The created PHP mailer.
83 */
84 public function createMailer($protocol = null);
85
86
87 /**
88 * Creates an email service object
89 *
90 * @return EmailService The created email service.
91 */
92 public function createService();
93
94
95 /**
96 * Creates an email repository object
97 *
98 * @return EmailRepository The created email repository.
99 */
100 public function createRepository();
101
102
103 /**
104 * Creates an email writer object
105 *
106 * @return EmailWriter The created email writer.
107 */
108 public function createWriter();
109
110
111 /**
112 * Create EmailReader Object
113 *
114 * @return EmailReader The created email deleter.
115 */
116 public function createReader();
117
118
119 /**
120 * Creates email deleter object
121 *
122 * @return EmailDeleter The created email deleter.
123 */
124 public function createDeleter();
125
126
127 /**
128 * Creates an attachments handler object
129 *
130 * @param string $p_uploadsDirPath (optional) You can specify a custom uploads directory path if you do not want
131 * the default "uploads" directory. The path must contain a "tmp" and an
132 * "attachments" directory otherwise the AttachmentsHandler class will not work
133 * properly.
134 *
135 * @return AttachmentsHandler The created attachments handler.
136 */
137 public function createAttachmentsHandler($p_uploadsDirPath = null);
138 }