cfm = new classFileManagement(); $this->api_key = $overrideApiKey ? $overrideApiKey : ipsRegistry::$settings['mandrill_api_key']; } /** * Send API Call * * @param string Method * @param array Arguments * @return stdClass Object from returned JSON */ public function __call( $method, $args ) { $send = array_merge( array( 'key' => $this->api_key ), ( isset( $args[0] ) and is_array( $args[0] ) ) ? $args[0] : array() ); if ( IPS_DOC_CHAR_SET != 'UTF-8' ) { $send['message']['html'] = IPSText::convertCharsets( $send['message']['html'], IPS_DOC_CHAR_SET, 'utf-8' ); } $response = $this->cfm->postFileContents( self::URL . str_replace( '_', '/', $method ) . '.json', json_encode( $send ) ); if ( $json = json_decode( $response ) ) { return $json; } return NULL; } }