1: <?php
2: /**
3: * Magento
4: *
5: * NOTICE OF LICENSE
6: *
7: * This source file is subject to the Open Software License (OSL 3.0)
8: * that is bundled with this package in the file LICENSE.txt.
9: * It is also available through the world-wide-web at this URL:
10: * http://opensource.org/licenses/osl-3.0.php
11: * If you did not receive a copy of the license and are unable to
12: * obtain it through the world-wide-web, please send an email
13: * to license@magentocommerce.com so we can send you a copy immediately.
14: *
15: * DISCLAIMER
16: *
17: * Do not edit or add to this file if you wish to upgrade Magento to newer
18: * versions in the future. If you wish to customize Magento for your
19: * needs please refer to http://www.magentocommerce.com for more information.
20: *
21: * @category Mage
22: * @package Mage_Core
23: * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24: * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25: */
26:
27: /**
28: * Email information model
29: * Email message may contain addresses in any of these three fields:
30: * -To: Primary recipients
31: * -Cc: Carbon copy to secondary recipients and other interested parties
32: * -Bcc: Blind carbon copy to tertiary recipients who receive the message
33: * without anyone else (including the To, Cc, and Bcc recipients) seeing who the tertiary recipients are
34: *
35: * @category Mage
36: * @package Mage_Core
37: * @author Magento Core Team <core@magentocommerce.com>
38: */
39: class Mage_Core_Model_Email_Info extends Varien_Object
40: {
41: /**
42: * Name list of "Bcc" recipients
43: *
44: * @var array
45: */
46: protected $_bccNames = array();
47:
48: /**
49: * Email list of "Bcc" recipients
50: *
51: * @var array
52: */
53: protected $_bccEmails = array();
54:
55: /**
56: * Name list of "To" recipients
57: *
58: * @var array
59: */
60: protected $_toNames = array();
61:
62: /**
63: * Email list of "To" recipients
64: *
65: * @var array
66: */
67: protected $_toEmails = array();
68:
69:
70: /**
71: * Add new "Bcc" recipient to current email
72: *
73: * @param string $email
74: * @param string|null $name
75: * @return Mage_Core_Model_Email_Info
76: */
77: public function addBcc($email, $name = null)
78: {
79: array_push($this->_bccNames, $name);
80: array_push($this->_bccEmails, $email);
81: return $this;
82: }
83:
84: /**
85: * Add new "To" recipient to current email
86: *
87: * @param string $email
88: * @param string|null $name
89: * @return Mage_Core_Model_Email_Info
90: */
91: public function addTo($email, $name = null)
92: {
93: array_push($this->_toNames, $name);
94: array_push($this->_toEmails, $email);
95: return $this;
96: }
97:
98: /**
99: * Get the name list of "Bcc" recipients
100: *
101: * @return array
102: */
103: public function getBccNames()
104: {
105: return $this->_bccNames;
106: }
107:
108: /**
109: * Get the email list of "Bcc" recipients
110: *
111: * @return array
112: */
113: public function getBccEmails()
114: {
115: return $this->_bccEmails;
116: }
117:
118: /**
119: * Get the name list of "To" recipients
120: *
121: * @return array
122: */
123: public function getToNames()
124: {
125: return $this->_toNames;
126: }
127:
128: /**
129: * Get the email list of "To" recipients
130: *
131: * @return array
132: */
133: public function getToEmails()
134: {
135: return $this->_toEmails;
136: }
137: }
138: