Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add BCC with $personalizationIndex #788

Closed
MarvinWue opened this issue Dec 3, 2018 · 2 comments · Fixed by #837
Closed

Unable to add BCC with $personalizationIndex #788

MarvinWue opened this issue Dec 3, 2018 · 2 comments · Fixed by #837
Labels
difficulty: medium fix is medium in difficulty status: help wanted requesting help from the community type: bug bug in the library

Comments

@MarvinWue
Copy link

MarvinWue commented Dec 3, 2018

Issue Summary

It's not possible to add CC/BCC when passing a $personalizationIndex.
The issue seems to be caused by the missing $substitutions parameter when calling addRecipientEmail in addCc and addBcc in the Mail class.

$this->addRecipientEmail(
	"Bcc",
	$bcc,
	$name,
	// substitutions are missing here
	$personalizationIndex,
	$personalization
);

Error

Fatal error: Uncaught SendGrid\Mail\TypeException: $substitutions must be an array. in ...\vendor\sendgrid\sendgrid\lib\mail\EmailAddress.php on line 162

Technical details:

  • sendgrid-php Version: 7.2.1
  • PHP Version: 7.1.16
@peter279k
Copy link
Contributor

@MarvinWue, thank you for your reply.

It looks like it missed the variable after tracing the line of code 👍 .

@thinkingserious thinkingserious added type: bug bug in the library status: help wanted requesting help from the community difficulty: medium fix is medium in difficulty up-for-grabs labels Dec 4, 2018
@thinkingserious
Copy link
Contributor

Hello @MarvinWue,

Thanks for taking the time to report this!

I've added this to our backlog for a fix and also opened it up to the community for a PR.

With Best Regards,

Elmer

thinkingserious added a commit that referenced this issue May 21, 2019
Fixes #788  - Add missing parameter for addCc and addBcc methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium fix is medium in difficulty status: help wanted requesting help from the community type: bug bug in the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants