Plant Posted September 30, 2010 Share Posted September 30, 2010 Hi everyone, I am writing a Drupal module to integrate the support aspects of WHMCS with Drupal, and I've run into two problems: 1 - I would need to add and get attachments to support tickets via the API. I could not find any API functions for this - do you know of any way to do this? 2 - I want to URL to view the ticket (on the Drupal site) to be: http://example.com/whmcs/view-ticket/{$id}/{$c} where {$id} is the ticket id (not the 6-digit tid) and {$c} is the hash of the ticket. This link should be included in the email template when a ticket has been opened. These two values (id and hash) are not available in the template - is there any way to use them in the email? Any help would be greatly appreciated! 0 Quote Link to comment Share on other sites More sharing options...
Plant Posted September 30, 2010 Author Share Posted September 30, 2010 OK, I found a solution (sort of) to problem number 2: In your email template, place this: {php} $link = mysql_connect('localhost', 'db_user', 'db_password'); mysql_select_db('database_name'); $query = 'SELECT id, c FROM tbltickets WHERE tid=' . $this->_tpl_vars['ticket_id']; $result = mysql_query($query); $line = mysql_fetch_array($result, MYSQL_ASSOC); $real_id = $line['id']; $c = $line['c']; echo "http://example.com/?q=whmcs/view-ticket/$real_id/$c"; {/php} I personally don't like this approach, and there must be some smarter place to put it than straight into the template. Is there a preprocess function somewhere? I'd be grateful if anyone has a cleaner solution. 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.