snake Posted December 10, 2018 Share Posted December 10, 2018 I have multiple websites and each has their own ticket DEPT in WHMCS, but I want the email signatures in each dept to be relevant to the dept/website rather than 1 generic signature for everything. I have no desire to run a completely separate WHMCS installation for each brand, this is unnecessary and would be overkill. I have looked at the multibrand plugin that is available but $200 is also a bit rich just for the sake of an email sig. any other solution? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 10, 2018 Share Posted December 10, 2018 goddammit - i'm supposed to be on holiday, but this question intrigued me... like a moth to a flame! 🦋 38 minutes ago, snake said: I have multiple websites and each has their own ticket DEPT in WHMCS, but I want the email signatures in each dept to be relevant to the dept/website rather than 1 generic signature for everything. you could use a hook to tweak the $signature variable on the supporttickets page in the admin area based on the dept ID value (you could do it by department name if you had to, but it's quicker for me to use ID). <?php # Ticket Signature Based on Support Department Hook # Written by brian! function ticket_signature_by_department_hook($vars) { if ($vars['filename'] == 'supporttickets') { $deptid = $vars['deptid']; if ($deptid == '1') { // Technical Support $signature = "Brian @ Technical Support"; } elseif ($deptid == '2') { // Billing $signature = "Brian @ Billing"; } if ($signature) { return array("signature" => $signature); } } } add_hook("AdminAreaPage", 1, "ticket_signature_by_department_hook"); ?> so this can overwrite the support ticket signature defined in your admin user account... for simplicity, i'm assuming there is only you, but you could easily expand the hook to get the adminid of the admin user and alter the signature accordingly for each admin user... the modified signature will be used in the support ticket emails generated via the supporttickets page too. 38 minutes ago, snake said: I have looked at the multibrand plugin that is available but $200 is also a bit rich just for the sake of an email sig. in that case, i'll sell you the above hook for $199.99 - a bargain! 😛 now, unless you tell me this hook has a fatal flaw and doesn't work, I really am going to disappear for my break! 🎄 0 Quote Link to comment Share on other sites More sharing options...
snake Posted December 10, 2018 Author Share Posted December 10, 2018 Thanks Brian.... could I make this use email templates for the sigs rather than hard coding them into the hook. This is not urgent, so feel free to reply after you have your break 🙂 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 10, 2018 Share Posted December 10, 2018 15 minutes ago, snake said: could I make this use email templates for the sigs rather than hard coding them into the hook. can you give an example of what you mean... 15 minutes ago, snake said: This is not urgent, so feel free to reply after you have your break i'll have forgotten about this in four weeks time - best to carry on while it's already in my head... break can start tomorrow! 📅 0 Quote Link to comment Share on other sites More sharing options...
snake Posted December 10, 2018 Author Share Posted December 10, 2018 If you login to whmcs and go to setup -> email templates then you will see all the different email templates that whmcs uses So the email sigs could be created here, and appended to the outgoing emails. This would make it much easier to create nice HTML sigs and to be able to edit them. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 10, 2018 Share Posted December 10, 2018 another option would be to ignore using any hooks and just add the custom signatures in the email templates in Smarty... {if $ticket_department eq "Technical Support"}Brian @ TechSupport{elseif $ticket_department eq "Billing"}Brian @ Billing{/if} as these templates are stored in the database, your changes should be safe from WHMCS upgrades (unless they mess it up!)... and you should be able to add your HTML into the output... using this may come unstuck if you have multiple support operators as I don't think the template can determine which admin is replying to a ticket. as with all Smarty code in the email templates, use the Source Code button (via help) to enter/edit your signature code. is that the answer you had in mind? 0 Quote Link to comment Share on other sites More sharing options...
snake Posted December 10, 2018 Author Share Posted December 10, 2018 I have looked under the help menu, but I don;t see any option for source code or smarty. Can you elaborate? 0 Quote Link to comment Share on other sites More sharing options...
snake Posted December 10, 2018 Author Share Posted December 10, 2018 sorry forget that, I just figured out what you mean. Thanks, it's so obvious now 🙂 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 11, 2018 Share Posted December 11, 2018 19 hours ago, snake said: So the email sigs could be created here, and appended to the outgoing emails. This would make it much easier to create nice HTML sigs and to be able to edit them. two further options spring to mind with this - an EmailPreSend / Mergefield hook that modifies the {$signature} mergefield value.. that would be simple enough to do... i'll bookmark the thread and feel free to let me know if you need me to look further into that type of hook in the New Year... wsa was reading it yesterday, so if he can think of any way to commercially exploit what i've posted, i'm sure that he will do so. also, we may be overcomplicating the solution if these support departments are the names of your websites - in that, you could keep {$signature} as they are (the admins name etc), and then just use {$ticket_department} to output the brand/site. {$signature}<br /> {ticket_department} and with that, I really am gone from this place for a month. 0 Quote Link to comment Share on other sites More sharing options...
sol2010 Posted August 17, 2022 Share Posted August 17, 2022 On 12/12/2018 at 1:03 AM, brian! said: two further options spring to mind with this - an EmailPreSend / Mergefield hook that modifies the {$signature} mergefield value.. that would be simple enough to do... i'll bookmark the thread and feel free to let me know if you need me to look further into that type of hook in the New Year... wsa was reading it yesterday, so if he can think of any way to commercially exploit what i've posted, i'm sure that he will do so. also, we may be overcomplicating the solution if these support departments are the names of your websites - in that, you could keep {$signature} as they are (the admins name etc), and then just use {$ticket_department} to output the brand/site. {$signature}<br /> {ticket_department} and with that, I really am gone from this place for a month. Would it be possible to have a custom signature for a specific dept, but retain the one set in the global signature for all others - however, without doing that in all of the individual email templates. So, some login something like this if is dept "3", show ONLY signature "hello" else - all other departments (except "3" , show signature "goodbye" How to achieve that? 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.