public function testRender() { $r = $this->api->render($this->EMAIL_ID, array("data" => $this->data)); $this->assertSuccess($r); $this->assertNotNull($r->html ?: $r->text); print 'Test render'; }
'thanks' => $lang['mails_thanks'], 'company_name' => $lang['site_long_name'], 'site_url' => $lang['site_url'], 'funding_overviews' => $fundingOverviews, 'trading_overviews' => $tradingOverviews , 'trade_ref' => $referenceNumber ) ); $API_KEY = $settings['sendwithus_key']; $options = array(); $api = new API($API_KEY, $options); if(isset($_POST['_preview'])){ $response = $api->render($templateKey, Array('template_data' => $email_params['email_data'])); $db=new DBConnection(); $userDetails=$db->getRow('users','user_account_num="'.$_GET['uid'].'"','user_email, user_firstname, user_lastname, user_username, user_account_num, user_balance'); $post_back_data = ''; foreach( $_POST as $key => $val ){ if($key == '_preview'){ continue; } $post_back_data .= '<input type="hidden" name="'.htmlSpecialChars( $key, ENT_COMPAT, 'UTF-8' ).'" value="'.htmlSpecialChars( $val, ENT_COMPAT, 'UTF-8' ).'" />'; } page_header(); echo '<div class="mainHolder"> <div class="hintHolder ui-state-default"><b>Preview Mail to User '.$userDetails['user_firstname'].' '.$userDetails['user_lastname'].' - '.$_GET['uid'].' ('.$userDetails['user_email'].')</b></div>