Jump to content

Add Tracking Tag to Emails


zebra

Recommended Posts

No not in the body, it's right after the email address.

All emails send from whmcs, should append .btag.it to the end of the email, so that it reads name@domain.com.btag.it – that’s it!

 

So when I send invoices, reminders and so on, I will be able to track it... I can see when the client has opened the email and if they have clicked a link within the email - See more here: http://bananatag.com/email-tracking/mobile/

Link to comment
Share on other sites

just set your system email address with the new .btag.it at the end?

i think it depend on how the BananaTag works as the .btag is supported by most of email clients, so the question is "if you added .btag to system address you will get the correct analytics?" i think it worth to give it a try as i don't see any other way till the moment

Link to comment
Share on other sites

just set your system email address with the new .btag.it at the end?

I was thinking that too, but I think the OP was looking for a way to use btag without the end user knowing.. and changing the system email address would change the login, so clients would have to be informed...

 

what you could probably do (in theory!) is do as Ady suggests and modify the system email addresses in the database to add .btag.it to them all - all outgoing emails should then use the btag service without the need for additional hooks.

 

however, if you wanted the clients to still use their own email address for logging in, you would need to make modifications to the templates...

 

1. modify the login form to add '.btag.it' to the username (system email) before/on submitting - I guess you could use javascript/jquery for that...

2. modify the order form to add '.btag.it' to the email when creating a new account - assume code would be similar to above...

3. modify contacts pages in client area so that if client adds a contact, it adds '.btag.it' to the email address...

4. modify displays of the system email address in the client area (e.g client homepage)... that should just be a very simple Smarty replace to remove the '.btag.it' part.

5. possible modification to any system emails mentioned in the body of the email templates - again, that will be the above Smarty replace.

 

there may be other steps I haven't thought of...

Link to comment
Share on other sites

@brain! he will need to do modification to the whole template, yes.

 

I have a simple modification (one modification) that can make this work as the OP need, @zebra:

1) open this file with any editor (i.e NotePad++), WHMCS/includes/classes/PHPMailer/class.phpmailer.php

2) search for this "function addAddress" approximately at line #701

and it looks like this:

public function addAddress($address, $name = '')
{
       return $this->addAnAddress('to', $address, $name);
}

 

you need to replace it, so it will look like this:

public function addAddress($address, $name = '')
{
       $findBTag = strpos($address, ".btag.it");
       if ($findBTag===false){
           $address = $address . '.btag.it';
       }
       return $this->addAnAddress('to', $address, $name);
}

 

this way it should change all recipient email address from xyz@example.com to xyz@example.com.btag.it

this will work 100%, and you will not have to do any hard modifications you need to try it and tell us what you get!!

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