lib/mail/Mail.php
public function addSubstitutions(
        $substitutions,
        $personalizationIndex = null,
        $personalization = null
    ) {
        if (current($substitutions) instanceof Substitution) {
            foreach ($substitutions as $substitution) {
                $this->addSubstitution($substitution);
            }
        } else {
            foreach ($substitutions as $key => $value) {
                $this->addSubstitution(
                    $key,
                    $value,
                    $personalizationIndex,
                    $personalization
                );
            }
        }
    }
public function addSubstitutions(
        $substitutions,
        $personalizationIndex = null,
        $personalization = null
    ) {
        if (current($substitutions) instanceof Substitution) {
            foreach ($substitutions as $substitution) {
                $this->addSubstitution($substitution);
            }
        } else {
            foreach ($substitutions as $key => $value) {
                $this->addSubstitution(
                    $key,
                    $value,
                    $personalizationIndex,
                    $personalization
                );
            }
        }
    }
public function addSubstitutions ( $ substitutions , $ personalizationIndex = null , $ personalization = null ) { if ( current ( $ substitutions ) instanceof Substitution ) { foreach ( $ substitutions as $ substitution ) { $ this -> addSubstitution ( $ substitution ) ; } } else { foreach ( $ substitutions as $ key => $ value ) { $ this -> addSubstitution ( $ key , $ value , $ personalizationIndex , $ personalization ) ; } } }
Adds multiple substitutions to a Personalization or Mail object

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

@param array|Substitution[] $substitutions Array of Substitution
objects or key/values
@param int|null $personalizationIndex Index into an array of
existing Personalization
objects
@param Personalization|null $personalization A pre-created
ersonalization object
Adds multiple substitutions to a Personalization or Mail object