private function buildDestinations($destinations) 
    {
        $ret = array();
        foreach ($destinations as $dest) 
        {
            $d = [
                "Destination" => $this->buildDestination($dest["dest"]),
                "ReplacementTemplateData" => $this->buildReplacements($dest["data"])
            ];
            if (isset($dest["tags"]) && $dest["tags"])
                $d['ReplacementTags'] = $this->buildTags($dest["tags"]);
            $ret[] = $d;
        } 
        return $ret;
    }
private function buildDestinations($destinations) 
    {
        $ret = array();
        foreach ($destinations as $dest) 
        {
            $d = [
                "Destination" => $this->buildDestination($dest["dest"]),
                "ReplacementTemplateData" => $this->buildReplacements($dest["data"])
            ];
            if (isset($dest["tags"]) && $dest["tags"])
                $d['ReplacementTags'] = $this->buildTags($dest["tags"]);
            $ret[] = $d;
        } 
        return $ret;
    }
private function buildDestinations ( $ destinations ) { $ ret = array ( ) ; foreach ( $ destinations as $ dest ) { $ d = [ "Destination" => $ this -> buildDestination ( $ dest [ "dest" ] ) , "ReplacementTemplateData" => $ this -> buildReplacements ( $ dest [ "data" ] ) ] ; if ( isset ( $ dest [ "tags" ] ) && $ dest [ "tags" ] ) $ d [ 'ReplacementTags' ] = $ this -> buildTags ( $ dest [ "tags" ] ) ; $ ret [ ] = $ d ; } return $ ret ; }
Create an array of destinations for bulk mail send

@param array $destinations in the required format
<pre>
[
"dest"   => destination emails (array ['to' => [...], 'cc' => [...], 'bcc' => [...]])
"data"   => replacement data (array)
"tags"   => tags (array [name1 => value1, ...])
],
...
</pre>
@return array
Create an array of destinations for bulk mail send