CRM Open Source Business & Social CRM Software

Results 1 to 2 of 2

Thread: How to modify From dropdown list on compose email screen

  1. #1
    sgandhi is offline Sugar Team Member
    Join Date
    Aug 2007
    Posts
    217

    Default How to modify From dropdown list on compose email screen

    Hi All,
    People have asked questions on how to modify Email compose screen's from dropdown list to not show Personal info as the first entry but as a last entry. Here is what you need to do.

    In Emails/EmailUI.php, there is a function called getFromAccountsArray. Check th eif block in that code. It sets ieAccountsFrom variable with the users personal info. Push that if block after foreach loop so that the system entry will go at the end of from dropdown list. So here is the new code.

    PHP Code:
        function getFromAccountsArray(&$ie) {
            global 
    $current_user;
            global 
    $app_strings;

            
    $ieAccountsFull $ie->retrieveAllByGroupIdWithGroupAccounts($current_user->id);
            
    $ieAccountsFrom= array();

            
    $oe = new OutboundEmail();
            
    $system $oe->getSystemMailerSettings();
            
    $ret $current_user->getPreferredEmail();

            foreach(
    $ieAccountsFull as $k => $v) {
                
    $name $v->get_stored_options('from_name');
                
    $addr $v->get_stored_options('from_addr');
                if (
    $name != null && $addr != null) {
                    
    $name from_html($name);
                    
    $ieAccountsFrom[] = array("value" => $v->id"text" => "{$name} ({$addr})");
                }
            }

            if(!empty(
    $system->id)) {
                require_once(
    'modules/Administration/Administration.php');
                
    $admin = new Administration();
                
    $admin->retrieveSettings(); //retrieve all admin settings.
                
    $ieAccountsFrom[] = array("value" => $system->id"text" =>
                    
    "{$ret['name']} ({$ret['email']})");
            }
            return 
    $ieAccountsFrom;
        } 
    -Samir

  2. #2
    lrm242 is offline Junior Member
    Join Date
    Jan 2009
    Posts
    1

    Default Re: How to modify From dropdown list on compose email screen

    Thanks Samir, that worked perfectly. Is there any side effect to simply commenting out the 'if' block rather than moving it? It has the effect of not showing the system email address at all, which is actually what I want to do. Will it break anything else if I do this?

    Thanks,

    Louis

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 11
    Last Post: 2009-02-26, 08:42 AM
  2. Replies: 0
    Last Post: 2008-06-07, 07:14 PM
  3. Replies: 14
    Last Post: 2008-04-04, 01:21 AM
  4. Replies: 1
    Last Post: 2008-02-18, 01:21 AM
  5. Replies: 1
    Last Post: 2006-10-03, 09:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •