Jump to content

Different signatures on ticket depts


snake

Recommended Posts

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?


 

Link to comment
Share on other sites

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! 🎄

Link to comment
Share on other sites

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! 📅

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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. headshake.gif

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. saying-bye-bye-smiley-emoticon.gif

Link to comment
Share on other sites

  • 3 years later...
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. headshake.gif

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. saying-bye-bye-smiley-emoticon.gif

 

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?

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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