File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,7 +261,8 @@ public function setMetadata(array $metadata){
261261 public function addRecipient (Recipient $ recipient ){
262262 $ this ->to [] = array (
263263 'email ' => $ recipient ->email ,
264- 'name ' => $ recipient ->name
264+ 'name ' => $ recipient ->name ,
265+ 'type ' => $ recipient ->type
265266 );
266267 $ this ->merge_vars [] = array (
267268 'rcpt ' => $ recipient ->email ,
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ class Recipient extends Struct{
2020 */
2121 public $ name ;
2222
23+ /**
24+ * @var string the recipient's header type i.e. 'to', 'cc', 'bcc'
25+ */
26+ public $ type = 'to ' ;
27+
2328 /**
2429 * @var array associative array of recipient-specific merge variables
2530 */
@@ -33,14 +38,18 @@ class Recipient extends Struct{
3338 /**
3439 * @param string $email the recipient's email address
3540 * @param string $name the recipient's name
41+ * @param string $type the recipient's header type i.e. 'to', 'cc', 'bcc'
3642 */
37- function __construct ($ email = NULL , $ name = NULL ){
43+ function __construct ($ email = NULL , $ name = NULL , $ type = NULL ){
3844 if (!is_null ($ email )){
3945 $ this ->email = $ email ;
4046 }
4147 if (!is_null ($ name )){
4248 $ this ->name = $ name ;
4349 }
50+ if (!is_null ($ type )){
51+ $ this ->type = $ type ;
52+ }
4453 }
4554
4655
@@ -105,4 +114,4 @@ public function setMetadata(array $metadata){
105114 public function getMetadata (){
106115 return $ this ->metadata ;
107116 }
108- }
117+ }
You can’t perform that action at this time.
0 commit comments