project183 Posted September 4, 2016 Share Posted September 4, 2016 Hello, On the documentation for the WHMCS API - http://docs.whmcs.com/API:Send_Email it states: The following email templates cannot be sent in this way: Automated Password Reset Password Reset Confirmation Password Reset Validation ... However i am able to perform these actions, below is a code snippet: public function resetAction() { $request = $this->getRequest(); if ( $request->isPost() ) { $params['action'] = 'getclientsdetails'; $params['email'] = $request->getPost( 'email' ); $reset = $this->backend->apiCall( $params ); if ( $reset->result == 'success' ) { $params['action'] = 'sendemail'; $params['messagename'] = 'Password Reset Validation'; $params['id'] = $reset->userid; $params['customvars'] = base64_encode(serialize([ 'pw_reset_url' => 'http://domain.tld/page/args...' ])); $this->backend->apiCall( $params ); } $this->getView()->assign( 'done', 1 ); } } This piece of code simply sends a email to WHMCS via the api, upon success we get the users client id to pass to the send e-mail command. This works well and using the templates i am able to build a password recovery system using the api but what im wondering is if i am missing something because the documentation is stating that these templates cannot be used. Thanks 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.