lib/mail/Personalization.php
public function jsonSerialize()
    {
        if ($this->getHasDynamicTemplate() == true) {
            $dynamic_substitutions = $this->getSubstitutions();
            $substitutions = null;
        } else {
            $substitutions = $this->getSubstitutions();
            $dynamic_substitutions = null;
        }

        return array_filter(
            [
                'to' => $this->getTos(),
                'cc' => $this->getCcs(),
                'bcc' => $this->getBccs(),
                'subject' => $this->getSubject(),
                'headers' => $this->getHeaders(),
                'substitutions' => $substitutions,
                'dynamic_template_data' => $dynamic_substitutions,
                'custom_args' => $this->getCustomArgs(),
                'send_at' => $this->getSendAt()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
public function jsonSerialize()
    {
        if ($this->getHasDynamicTemplate() == true) {
            $dynamic_substitutions = $this->getSubstitutions();
            $substitutions = null;
        } else {
            $substitutions = $this->getSubstitutions();
            $dynamic_substitutions = null;
        }

        return array_filter(
            [
                'to' => $this->getTos(),
                'cc' => $this->getCcs(),
                'bcc' => $this->getBccs(),
                'subject' => $this->getSubject(),
                'headers' => $this->getHeaders(),
                'substitutions' => $substitutions,
                'dynamic_template_data' => $dynamic_substitutions,
                'custom_args' => $this->getCustomArgs(),
                'send_at' => $this->getSendAt()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
public function jsonSerialize ( ) { if ( $ this -> getHasDynamicTemplate ( ) == true ) { $ dynamic_substitutions = $ this -> getSubstitutions ( ) ; $ substitutions = null ; } else { $ substitutions = $ this -> getSubstitutions ( ) ; $ dynamic_substitutions = null ; } return array_filter ( [ 'to' => $ this -> getTos ( ) , 'cc' => $ this -> getCcs ( ) , 'bcc' => $ this -> getBccs ( ) , 'subject' => $ this -> getSubject ( ) , 'headers' => $ this -> getHeaders ( ) , 'substitutions' => $ substitutions , 'dynamic_template_data' => $ dynamic_substitutions , 'custom_args' => $ this -> getCustomArgs ( ) , 'send_at' => $ this -> getSendAt ( ) ] , function ( $ value ) { return $ value !== null ; } ) ? : null ; }
Return an array representing a Personalization object for the Twilio SendGrid API

@return null|array
Return an array representing a Personalization object for the Twilio SendGrid API