lib/mail/Mail.php
public function setSubject(
        $subject,
        $personalizationIndex = null,
        $personalization = null
    ) {
        if (!($subject instanceof Subject)) {
            $subject = new Subject($subject);
        }

        if ($personalization != null) {
            $personalization->setSubject($subject);
            $this->addPersonalization($personalization);
            return;
        }
        if ($personalizationIndex != null) {
            $this->personalization[$personalizationIndex]->setSubject($subject);
            return;
        }
        $this->setGlobalSubject($subject);
        return;
    }
public function setSubject(
        $subject,
        $personalizationIndex = null,
        $personalization = null
    ) {
        if (!($subject instanceof Subject)) {
            $subject = new Subject($subject);
        }

        if ($personalization != null) {
            $personalization->setSubject($subject);
            $this->addPersonalization($personalization);
            return;
        }
        if ($personalizationIndex != null) {
            $this->personalization[$personalizationIndex]->setSubject($subject);
            return;
        }
        $this->setGlobalSubject($subject);
        return;
    }
public function setSubject ( $ subject , $ personalizationIndex = null , $ personalization = null ) { if ( ! ( $ subject instanceof Subject ) ) { $ subject = new Subject ( $ subject ) ; } if ( $ personalization != null ) { $ personalization -> setSubject ( $ subject ) ; $ this -> addPersonalization ( $ personalization ) ; return ; } if ( $ personalizationIndex != null ) { $ this -> personalization [ $ personalizationIndex ] -> setSubject ( $ subject ) ; return ; } $ this -> setGlobalSubject ( $ subject ) ; return ; }
Add a subject to a Personalization or Mail object

If you don't provide a Personalization object or index, the
subject will be global to entire message. Note that
subjects added to Personalization objects override
global subjects.

@param string|Subject $subject Email subject
@param int|null $personalizationIndex Index into an array of
existing Personalization
objects
@param Personalization|null $personalization A pre-created
Personalization object
Add a subject to a Personalization or Mail object