Results 1 to 7 of 7

Thread: Lead Assignment Notice - Need to Add Email

  1. #1
    cstearns is offline Junior Member
    Join Date
    Mar 2007
    Posts
    2

    Default Lead Assignment Notice - Need to Add Email

    I would like to add the email of the lead to the notification message that is sent when a lead is assigned.

    SugarCRM Open Source v5b
    IIS

    I have edited the /include/language/en_us.notify_template.html as follows:

    Name: {LEAD_NAME}
    Email: {EMAIL1}
    Phone: {PHONE_WORK}
    Lead Source: {LEAD_SOURCE}
    Status: {LEAD_STATUS}
    Description: {LEAD_DESCRIPTION}


    I have edited the /modules/leads/lead.php as follows:

    function set_notification_body($xtpl, $lead)
    {

    global $app_list_strings;
    global $locale;
    $xtpl->assign("LEAD_NAME", $locale->getLocaleFormattedName($lead->first_name, $lead->last_name, $lead->salutation));
    $xtpl->assign("LEAD_SOURCE", (isset($lead->lead_source) ? $app_list_strings['lead_source_dom'][$lead->lead_source] : ""));
    $xtpl->assign("LEAD_STATUS", (isset($lead->status)? $app_list_strings['lead_status_dom'][$lead->status]:""));
    $xtpl->assign("LEAD_DESCRIPTION", $lead->description);
    $xtpl->assign("EMAIL1", $lead->email1);
    $xtpl->assign("PHONE_WORK", $lead->phone_work);

    return $xtpl;
    }

    The email field does not get assigned to the notice email message.

    I have also tried print_r($lead) This shows that the email1 variable to be empty.

    How do I get the lead email into the notice message. Also does anyone know if it is possible set the reply-to of the notice message to the lead email address?

    Thank you for your help.

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Lead Assignment Notice - Need to Add Email

    Hi, cstearns

    In the SugarCRM 5.0 the Person and Company modules (Prospects, Leads, Accounts, Contacts) has no more the email1 and email2 fields, now the emails fields are in the table email_addr_bean, so you have to get the lead email from this table.

    Cheers

    --
    André Lopes
    Lâmpada Global Services
    Rua Bela Cintra, 299 conjunto. 51
    São Paulo, SP 01415-000
    tel1. 55 11 3237-3110
    cel. 55 11 7636-5859
    e-mail: info@lampadacrm.com.br

  3. #3
    cstearns is offline Junior Member
    Join Date
    Mar 2007
    Posts
    2

    Default Re: Lead Assignment Notice - Need to Add Email

    Thanks for the tip. How do I make the lead email address available to the set_notification_body function in lead.php?

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Lead Assignment Notice - Need to Add Email

    Hi, cstearns.

    You can do this using this code:

    PHP Code:
    $emails $focus->emailAddress->getAddressesByGUID($focus->id'Leads'); 
    $emails is an array containing all addresses for the current $focus.

    Cheers

    --
    André Lopes
    Lâmpada Global Services
    Rua Bela Cintra, 299 conjunto. 51
    São Paulo, SP 01415-000
    tel1. 55 11 3237-3110
    cel. 55 11 7636-5859
    e-mail: info@lampadacrm.com.br

  5. #5
    smealy is offline Member
    Join Date
    Jan 2007
    Posts
    7

    Default Re: Lead Assignment Notice - Need to Add Email

    Is it possible to get just a little more detail?

    I am not a PHP developer so I am struggling trying to figure out how to implement the solution shown.

    The file containing the templates for all assignment notifications is an html file and references variables that <> field names in the tables so there must be a file somewhere that declares those variables...is this where to include this command?

    I desperately need to add information to the default template, right now I use a workflow triggered email that means the sales people get two notifications. This annoys them :-)

    Thanks!

  6. #6
    derek.fischer is offline Junior Member
    Join Date
    Dec 2008
    Posts
    2

    Default Re: Lead Assignment Notice - Need to Add Email

    I'm looking to do the exact same thing you were requesting a while back. Any chance that you could post what you ended up doing? I too am not a PHP programmer and could use some assistance.

    Thanks,

    Derek

  7. #7
    marklark is offline Sugar Community Member
    Join Date
    Jan 2010
    Location
    Colorado Springs, USA
    Posts
    29

    Default Re: Lead Assignment Notice - Need to Add Email

    This seems like it might be better achieved using an on-change logic hook for leads.

    The current solution here doesn't seem to be upgrade safe.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Email management - Improvements in future releases
    By manoj in forum Feature Requests
    Replies: 102
    Last Post: 2009-11-17, 06:43 AM
  2. Using Lead Email address when sending Emails
    By malcolmh in forum Feature Requests
    Replies: 1
    Last Post: 2009-07-31, 01:36 PM
  3. Replies: 1
    Last Post: 2007-02-21, 11:42 AM
  4. Lead Dashlet - add account
    By 3v3ntiq in forum Feature Requests
    Replies: 2
    Last Post: 2006-09-25, 11:00 PM
  5. Replies: 0
    Last Post: 2006-05-04, 01:27 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
  •