Jump to content

Pass array to "cc" for WireMail


louisstephens
 Share

Recommended Posts

I believe I have hit a roadblock on this one. I am trying to pass an array to a "cc" in wiremail (using wiremailsmpt to extend). Everything else is working, but I am getting an "invalid email address" for $cc_recipient[0]. I looked in wiremail, and it is checking to see if it is a valid email address before sending (which my variable is not). Is there a way around this by chance?

Link to comment
Share on other sites

$cc_recipient[0] is the first item in the array - if you dump that item, is it a valid email address?

Also, you say WireMail but as far as I know there is no CC method in the WireMail base class. Maybe you are using some module that extends WireMail?

Link to comment
Share on other sites

WireMail::header() function accepts string values only.

// setting additional headers in WireMail
$recipientsArray = array('valid1@example.com', 'valid2@example.com');
$recipientsString = implode(",", $recipientsArray);

$wireMailObject->header('cc', $recipientsString); // OR
$wireMailObject->header('bcc', $recipientsString);

 

  • Like 1
Link to comment
Share on other sites

15 hours ago, Robin S said:

$cc_recipient[0] is the first item in the array - if you dump that item, is it a valid email address?

Also, you say WireMail but as far as I know there is no CC method in the WireMail base class. Maybe you are using some module that extends WireMail?

Sorry @Robin S, I was using WireMailSMPT to extend wiremail. I have edited my post to reflect this.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...