by

logo-epi

Webservice MailMerge

$oClient = new Zend_Rest_Client( 
        "https://" . $aMailMerge[ 'login' ] . ":" . $aMailMerge[ 'password' ] . "@mailmerge.preprod.voozanoo.net/mailmerge/ws/mailing" 
    );

    $oClient->processing_mode( "synchrone" );
    $oClient->id_model( 82 );

    $oResult = $oClient->post();
    
    if ( false === $oResult->isSuccess() ) {
        throw new Exception( sprintf( 'An error occured while calling webservice : %s ', $oResult->message ) );
    }

    header( 'content-type: application/pdf' );    
    echo UnzipString( base64_decode( (string) $oResult->response->generated_file ) );