Email subject does not contain Case number when initiating "compose mail" from within a case.

Hi All,

SuiteCRM Version 7.11.7
PHP : 7.2
Platform : Nginx, MariaDB on Ubuntu

When I try to compose mail from within a Case, it does not add the case number to the subject line, but adds the case subject line . Is there a way for the case number to be added to the subject line?

To elaborate, When I open case i have subpanels below among which is the Activities subpanel. From Activities I can compose an email. But when I click on compose and when the pop up for compose appears, it has the case subject as the subject line of the email, which is correct. But it does not append the case number even though the system will be able to get the case number, similar to getting the case subject.

The problem with this being, if I initiate a mail from within a case, since the email does not go with a case number, any reply to that email gets created as a new case.

Any help on how this can be achived would be of great help.

Thanks and Regards.

Hhm I don’t know. From a quick look at the code, maybe you can try setting breakpoints on the calls to

createEmailLink function in this file

https://github.com/salesagility/SuiteCRM/blob/master/modules/Emails/EmailUI.php

Try to find out which one is being called for Cases screen, and set some condition there - “if this is a Case record, add the case number”.

1 Like

If someone has the same problem, the findings below might help.

Line number 101 of this file - “include/generic/SugarWidgets/SugarWidgetSubPanelTopComposeEmailButton.php” builds a HTML tag with the subject line contained within it as a field. This tag gets loaded against the “compose email” button on the activities subpanel.

The button “Compose Email” when clicked does an ajax call to the file jssource/src_files/include/javascript/EmailsComposeViewModal.js where it is displayed. You will have to change a few variables there as it does not take the sent values directly to fill the compose page controls.

Also remember that the .js file is minified and cached which means that you have to rebuild the .js file from admin and also delete the cache files from your browser for you to start seeing any change.

Cheers.

@Preetham nice find.

If your solution is generic enough, maybe you could propose this change as a PR to the core code? That way everyone else in the future would have access to this feature.

Sure @pgr. Would love to propose the change. It does look generic, considering that a mail sent from a case should require the case number. But am not very certain about it though.