Skip to content

Conversation

@geryjuhasz
Copy link
Contributor

@geryjuhasz geryjuhasz commented Oct 8, 2019

Fixes

Fixes #813

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 Guide] and my PR follows them.
  • I updated my branch with the development 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 in line documentation to the code I modified

Short description of what this PR does:

If you have questions, please send an email to Twilio Sendgrid, or file a Github Issue in this repository.

@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Oct 8, 2019
public function getSubject($personalizationIndex = 0)
{
return $this->personalization[$personalizationIndex]->getSubject();
return $this->personalization ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change doesn't take into account setting the subject before any personalizations are added. Using the OPs example:

$mail = new \SendGrid\Mail\Mail();
$mail->setSubject('my subject');
$mail->getSubject();

The returned subject is still null.

@childish-sambino childish-sambino changed the title Return global subject if there is no personalization - Fixes #813 fix: Return global subject if there is no personalization Feb 13, 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.

Unable to get subject after setting it

3 participants