Best way to add extra info to assign notification email

Hi,

I would like to add extra information to the notification email template. More information regarding the record that is being assigned. When I add $contacts_name using the insert button it doesn't seem to be working? Is there an easy (read: non programming) to add extra information to the assign notification mail?

Parents Reply Children
  • Hi

    I created a Document.php which is extending the core file (custom/modules/Documents/Document.php) : 

    <?PHP
    
    require_once('modules/Documents/Document.php');
    class CustomDocument extends Document {
    
        function set_notification_body($xtpl, $document)
        {
    	    $document->load_relationship('accounts');
    	    foreach ($document->accounts->getBeans() as $acc) {
                $xtpl->assign("CUSTOMER", $acc->name);
            	$xtpl->assign("CUSTOMERNUM", $acc->customernum_c);
        	}
    
            $xtpl->assign("NAME", $document->document_name);
    
            return $xtpl;
        }
    
    }

    And my custom/include/language/en_us.notify_template.html

    <!-- BEGIN: Document_Subject -->
    SugarCRM - {CUSTOMER} - Document {NAME} assigned
    <!-- END: Document_Subject -->
    <!-- BEGIN: Document -->
    {ASSIGNER} has assigned the Document {NAME} to {ASSIGNED_USER} for {CUSTOMER} ({CUSTOMERNUM}).
    
    You may review this Document at:
    {URL}
    <!-- END: Document -->

    You have to add the whole assignment templates otherwise it won't display the other notifications.

    Is this ok for you ?

    Best regards,

    Enes