Blog

vTiger MOD: Better formated Emails in vTiger

I found several problems when using the build-in Email Function / Module in vTiger. I´m using the internal Mailsending to send emails to Leads, so i have them direktly attached to the customer. When selecting "Send Email " beneath a Lead, the emailmodule opens. Then  i select a mail-template and the text is entered in my Email field. And here starts the fun:

1.Wysiwyg-Editor Problems

2. Signature Problem

3. From-Name in Email needs change

4. Alternate TEXT Emailtext instead of just HTML 

 

1.Wysiwyg-Editor Problems

Those of You that don´t have Problems with the fck Editor, don´t need to kill it. In my case firefox crashed and in IE there where also some bugs. Anyway i found it better to have a Text-Email+Simple HTML instead a fullblown HTML one, which might not be read by some folks using Webmailers. 

To disable the FCk i did it the dirty way for now:

modules/Emails/EditView.html around Line 107 find:

 <!– oFCKeditor.ReplaceTextarea() ; –>
Commented out the replacement Call

———————–
 

2. Signature Problem

The signature in the Email is taken from the Users Signature but it is wrapped with font-Tag in the HTML Email. I took those out an killed also the "newLine2break"-nl2br around the signature. Did also looked not very nice and is obsolete.

modules/Emails/send_mail.php around Line 54 find:

$contents .= ‘<br><br><font color=darkgrey>’.nl2br($sign).’</font>’;
replace with:
$contents .= ‘<br><br>’.$sign.”;

———————– 

3. From-Name in Email needs change

  When sending the Emails the vTiger CRM-Username is taken into the From-Name . This is not so nice because the Clients don´t really need to know my Login Name. I made an extra query to fetch another Piece of the users Data:
modules/Emails/send_mail.php around Line 62 find:

$initialfrom = $from;
replace with:
$sql="select department from users where user_name=’" .$from ."’" ;
$result = $adb->query($sql);
$initialfrom = $adb->query_result($result,0,"department");

Watch out you can put in any field from the Users-Table in thew select statement. Currently it takes the department as sender name. it would be nice to have an Admin Option for this.

 ———————–

4. Alternate TEXT Emailtext instead of just HTML 

hey cool phpmailer provides a function to add alternative text to a HTMl message… so why don´t we use it??
 This is by far not the only place where there is such an alternate Email text. You can just Search over your vTiger folder to find them all.

modules/Emails/send_mail.php around Line 155 find:

$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
replace with:
$mail->AltBody = strip_tags($contents);

 ———————–
 ———————–

Those are just some Bugs. There are some more f.Ex. with the Emailtemplate merging. i might cover those later.

By the way, i could provide the patched files. But If you try this yourself, you might bring the vTiger CRM community forward in the future and i´m not yet satisfied with the only the above :-)

Please feel free to give me some Feedback. 

5 Comments to vTiger MOD: Better formated Emails in vTiger

  1. 29.09.2006 at 8:48

    Hi!

    I am Richie from vtiger.

    Just wanted to let you know that we have released vtigercrm-5.0.0.

    * vtiger crm has been downloaded close to 0.5 million times already.
    http://sourceforge.net/projects/vtigercrm

    Some of the key updates are :

    * Improved installer for both Windows and Linux
    * More robust functionalities.
    * Customizable
    * UI and Usability revamp (not just enhancements!)
    * Updated Outlook Plugin with sync facility
    * Updated Thunderbird Plugin
    * Ajax integration
    * Enterprise-grade security management

    We are planning to release the 5.0.1 version of the product by the end of next week.
    You can have a look at : http://www.vtiger.com for the latest demo.

    Thanks for taking out the time to read this.

    Richie

  2. 05.07.2006 at 15:13

    Recently we have replaced our email functionality addressing most of the issues that you are mentioning. Please give a try vtiger 5 beta at:

    http://vtiger.com/products/crm/demo_5beta/index.php

    Your feedback will help us a lot improving the product further.

    Thanks,
    Gopal

  3. Thorsten's Gravatar Thorsten
    08.06.2006 at 15:26

    so funktioniert das mit dem Absender in 4.2.3 bei mir:

    in send_mail.php ca. Zeile 98
    findet Ihr:

    $mail->FromName = $initialfrom;

    ersete diese eine Zeile durch die BEIDEN Zeilen
    global $current_user;
    $mail->FromName = $current_user->department;

  4. Thorsten's Gravatar Thorsten
    07.06.2006 at 13:23

    No. 3: doesn´t work with me

    I replaced the ” $initialfrom = $from; ”
    with
    your code wich produces the following error:

    Fatal error: Call to a member function on a non-object in /srv/www/htdocs/web14/html/vtiger/include/database/PearDatabase.php on line 434

    Can You please help? I´m using 4.2.3