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
  • Hi Jeroen,

    We were asked for the same thing by our customer, to customize the assign template, and we have to add some code to add more informations to perform that ... I don't know if with the newest versions of sugar we can't customize directly with the studio or smthng like that ? 

    We did the trick in Sugar V10.0.4.

    Have a nice week-end,

    Best regards,

    Enes

  • Hi, 

    where did you add the extra code to? 

Reply Children
  • Hi

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

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    <?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;
    }
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    <!-- 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 -->
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

    Is this ok for you ?

    Best regards,

    Enes