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

feat: Mail constructor: Added support for array of Substitution instances using $globalSubstitutions #978

Merged
merged 7 commits into from
Jun 11, 2020
Merged

feat: Mail constructor: Added support for array of Substitution instances using $globalSubstitutions #978

merged 7 commits into from
Jun 11, 2020

Conversation

kampalex
Copy link
Contributor

The Mail constructor offers argument $globalSubstitutions.
While studying testWithIndividualSubjectsDynamicTemplates, mentioned argument is highlighted because an array isn't expected here. Current PHPDoc defines 'array of Substitution instances' or null, but not a normal array. To fix this, I've added array as expected datatype in PHPDoc.

In addition, passing an 'array of Substitution instances' will be processed properly.

ps. Maybe a better description of 'how to use the constructor' can be defined. I am open to feedback.

     * If passing parameters into this constructor, include $from, $to, $subject,
     * $plainTextContent, $htmlContent and $globalSubstitutions at a minimum.
     * If you don't supply any, a Personalization object will be created for you.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the master branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

kampalex added 7 commits May 19, 2020 15:38
Updated code base from upstream repository
Update repository using sendgrid/master
Sync local repository using original
Update repository using sendgrid/master
Sync local repository using original
Sync local repository using original
…titutions, as suggested by PHPDoc

Added array datatype hint, which prevents 'unexpected parameter type'
@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Jun 11, 2020
@childish-sambino childish-sambino merged commit 02c2c2b into sendgrid:master Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: code review request requesting a community code review or review from Twilio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants