Jump to content

Chrisfish

Member
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Chrisfish

  • Rank
    Junior Member
  1. Thanks for the feedback, you can indeed use Smarty in the main php file of the module. I want to use different templates for different pages though, and calling Smarty this way doesn't work in the Controller. I currently worked around this issue this way: function module_output($vars) { // ... $smarty = new Smarty(); $vars['smarty'] = $smarty; $dispatcher = new AdminDispatcher(); $response = $dispatcher->dispatch($action, $vars); echo $response; } And then I use it in the controller this way: class Controller { /** * An action */ public function index($vars) { // ... $smarty = $vars['smarty']; $smarty->assign('version', $vars['version']); $smarty->assign('systemUrl', $url); $smarty->assign('addonURL', $url . '/admin/addonmodules.php?module=my_addon'); // ... $smarty->caching = false; $smarty->compile_dir = $GLOBALS['templates_compiledir']; $smarty->display(dirname(__FILE__) . '/../../templates/index.tpl'); } }
  2. Hi, I started a custom module using the sample as a base: https://github.com/WHMCS/sample-addon-module I can't find anything relevant to explain how to use templates for admin page. I tried to load Smarty in different ways, but it always fails. Thanks,
  3. Hi, I was wondering if it was possible, through configuration or using an addon, to reply to the customer's original email, when using email piping, instead of starting the discussion in a separate email. Current Example: Customer sends a support request by email Email is piped into WHMCS WHMCS sends a ticket creation notification as a separate email Any further communication from WHMCS is part of the second email chain I would like to know if there is a way to set this up so the customer never knows there is a ticket. He sends a request, and any reply from WHMCS comes as a reply to the original email. I used to use Freshdesk previously, and this is how it used to work. Thanks,
  4. Hi, I was trying to achieve the same thing and did it by implemeting the following hook: /** * Sets the status of new invoices to Draft * @params array $vars [ * source => [adminarea, api, autogen] * user => (string) * invoiceid => (int) * status => (string) * ] */ add_hook('InvoiceCreation', 10, function($vars) { try { Capsule::table('tblinvoices') ->where('id', $vars['invoiceid']) ->update( [ 'status' => 'Draft', ] ); logActivity(sprintf('Invoice %d status automatically set to draft', $vars['invoiceid']), 0); } catch (\Exception $e) { logActivity(sprintf('Invoice %d status could not be set to draft', $vars['invoiceid']), 0); } });
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated