Results 1 to 8 of 8

Thread: Newbie Q: How do I modify the Assignment Email Template?

  1. #1
    plebe is offline Junior Member
    Join Date
    Sep 2007
    Posts
    4

    Default Newbie Q: How do I modify the Assignment Email Template?

    I can't seem to find the template for the automated emails that are sent on notification. Can someone point me to the right place, or file?

    Thanks,,

  2. #2
    ivolator's Avatar
    ivolator is offline Sugar Community Member
    Join Date
    Sep 2006
    Location
    Dagobah
    Posts
    98

    Default Re: Newbie Q: How do I modify the Assignment Email Template?

    The template is in include/language/en_us.notify_template.html

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

    Default Re: Newbie Q: How do I modify the Assignment Email Template?

    Thanks for pointing to the file.

    My question is now this:

    I can see the code for each alert in the file and can tell that certain dynamic information is being pulled in from the database. My problem is that the variables are obviously not the field names as they exist in the database and after literally hours of searching I cannot see where they are defined. The vardef files are not useful as they do not follow that naming either.

    I need to add two extra pieces of information to the lead assignment template, pulling each one from a custom field.

    How do I find what to call these?

    Thanks!

  4. #4
    marcuscherry is offline Sugar Community Member
    Join Date
    Aug 2007
    Posts
    44

    Smile Re: Newbie Q: How do I modify the Assignment Email Template?

    I was looking to do the same thing and found the answer at this post
    http://www.sugarcrm.com/forums/showt...fication+email

  5. #5
    marcuscherry is offline Sugar Community Member
    Join Date
    Aug 2007
    Posts
    44

    Post Re: Newbie Q: How do I modify the Assignment Email Template?

    Following on from that last post - I'm not much good with php and I can work out how to pull text fields into the email notification template, but I can't work out how to:
    1. Show the Campaign associated with the lead
    2. Show items from dropdown fields

    Here's the code I'm using at the moment in leads.php which doesn't work. The field "interest_c" is the drop-down field.

    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("CAMPAIGN", $lead->campaign);
    $xtpl->assign("PHONE_WORK", $lead->phone_work);
    $xtpl->assign("EMAIL1", $lead->email1);
    $xtpl->assign("INTEREST_C", (isset($lead->interest_c)? $app_list_strings['interest_c'][$lead->interest_c]:""));
    Any help with the syntax I should be using here would be very much appreciated

    Thanks

    Marcus

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

    Default Re: Newbie Q: How do I modify the Assignment Email Template?

    I can see the problem but not being a php developer I'm not sure how to fix it.

    In the variable declarations at the top of the page the table is set to "leads". The field you are trying to add (and the fields I'm trying to add) are in the leads_cstm table. So, not only would you need to code that table in I'm guessing you'd need to spell out the relationship to the leads table so that you're pulling back the correct information.

    ...seems like this should be a little bit easier

    I have also posted the issue in the feature requests forum, requesting that they make this editable from within the application.

  7. #7
    teldarren is offline Senior Member
    Join Date
    Jan 2009
    Posts
    41

    Question Re: Newbie Q: How do I modify the Assignment Email Template?

    Could someone please provide some more details on how to do this?

    I finally found all the files and code where the changes need to be made, but i don't know exactly what to do. (not a coder).

    include/language/en_us.notify_template.html
    Code:
    <!-- BEGIN: Case -->
    {ASSIGNER} has assigned a Case to {ASSIGNED_USER}.
    
    Account: {account_name}   <---I want to have the account name listed here (currently shows up blank)
    Subject: {CASE_SUBJECT}
    Priority: {CASE_PRIORITY}
    Status: {CASE_STATUS}
    Description: {CASE_DESCRIPTION}
    
    You may review this Case at:
    <{URL}>
    <!-- END: Case -->
    modules/cases/case.php
    Code:
    function set_notification_body($xtpl, $case)
    	{
    		global $app_list_strings;
    
    		$xtpl->assign("CASE_SUBJECT", $case->name);
    		$xtpl->assign("CASE_PRIORITY", (isset($case->priority) ? $app_list_strings['case_priority_dom'][$case->priority]:""));
    		$xtpl->assign("CASE_STATUS", (isset($case->status) ? $app_list_strings['case_status_dom'][$case->status]:""));
    		$xtpl->assign("CASE_DESCRIPTION", $case->description);
    
    		return $xtpl;
    What exactly would i need to add here?????
    Also, if a change is made here, is it upgrade safe? or would another file need to be created in custom/modules/cases?

    does anything need to be changed or updated in include/language/en_us.lang.php???

    Thanks,

    Darren
    Last edited by teldarren; 2009-03-18 at 09:27 PM. Reason: adding more info per request of a forum member

  8. #8
    Varun50 is offline Senior Member
    Join Date
    Jul 2009
    Posts
    23

    Default Re: Newbie Q: How do I modify the Assignment Email Template?

    Hi add this code

    $xtpl->assign("ACCOUNT_NAME", $account->name); in case.php

    and add this code

    Account: {ACCOUNT_NAME}

    I m not much aware of account module so u have to do r&d on it but it is the way to do template in mail function .Hope this helps

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. HOW-TO guide for Email Campaigns.
    By agupta in forum Marketing/Campaign Management
    Replies: 146
    Last Post: 2012-01-31, 03:08 PM
  2. Email Handling and Auto Assignment to Sugar Contacts
    By dakman1 in forum General Discussion
    Replies: 3
    Last Post: 2008-01-22, 04:46 PM
  3. Replies: 3
    Last Post: 2006-01-05, 06:01 PM
  4. SugarCrm 4.0 Patch
    By mgamboa in forum General Discussion
    Replies: 0
    Last Post: 2005-12-21, 04:14 PM
  5. Can't select email template (Newbie here)
    By newstrategy in forum Help
    Replies: 1
    Last Post: 2005-10-14, 05:52 PM

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
  •