Sending new assignee email while creating a case is not working. #5181

Open
opened 2026-02-20 16:31:02 -05:00 by deekerman · 5 comments
Owner

Originally created by @ebsi-RBakade on GitHub (Apr 3, 2024).

Issue

Email notification is not sending while creating a case at the first timet to assignee. But when we update case and reassign case to other User then it works.

Expected Behavior

It should send an email to assignee for newly created Case.

Actual Behavior

Email is not sending to assignee when new case is created.

Possible Fix

Move the following line below if else block
https://github.com/salesagility/SuiteCRM/blob/hotfix/data/SugarBean.php#L2411

$this->_sendNotifications($check_notify);
it should be below if else block because at that time case is not created. It gets only created in the else block having insert() function.
When I moved _sendNotification() line below if else block then it’s working as intended.

Steps to Reproduce

  1. create a new case by filling all the required fields.
  2. make sure that assignee field should not be blank and that assignee should have valid email address.
  3. save the case.
  4. email is received without contact and and case number.

Context

Your Environment

  • SuiteCRM Version used: 7.4.3
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Google Chrome 123.0.6312.86 (Official Build) (32-bit)
  • Environment name and version (e.g. MySQL, PHP 7): MariaDB : 5.5.5-10.1.21, PHP 5.3
  • Operating System and version (e.g Ubuntu 16.04):Windows 32 Bit
Originally created by @ebsi-RBakade on GitHub (Apr 3, 2024). <!--- Provide a general summary of the issue in the **Title** above --> <!--- Before you open an issue, please check if a similar issue already exists or has been closed before. ---> <!--- If you have discovered a security risk please report it by emailing security@suitecrm.com. This will be delivered to the product team who handle security issues. Please don't disclose security bugs publicly until they have been handled by the security team. ---> <!--- Please be aware that as of the 31st January 2022 we no longer support 7.10.x. New issues referring to 7.10.x will only be valid if applicable to 7.12.x and above. If your issue is still applicable in 7.12.x, please create the issue following the template below --> #### Issue Email notification is not sending while creating a case at the first timet to assignee. But when we update case and reassign case to other User then it works. <!--- Provide a more detailed introduction to the issue itself, and why you consider it to be a bug --> <!--- Ensure that all code ``` is surrounded ``` by triple back quotes. This can also be done over multiple lines --> #### Expected Behavior It should send an email to assignee for newly created Case. <!--- Tell us what should happen --> #### Actual Behavior Email is not sending to assignee when new case is created. <!--- Tell us what happens instead --> <!--- Also please check relevant logs (suitecrm.log, php error.log etc.) --> #### Possible Fix Move the following line below if else block https://github.com/salesagility/SuiteCRM/blob/hotfix/data/SugarBean.php#L2411 `$this->_sendNotifications($check_notify);` it should be below if else block because at that time case is not created. It gets only created in the else block having insert() function. When I moved _sendNotification() line below if else block then it’s working as intended. <!--- Not obligatory, but suggest a fix or reason for the bug --> #### Steps to Reproduce <!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- reproduce this bug include code to reproduce, if relevant --> 1. create a new case by filling all the required fields. 2. make sure that assignee field should not be blank and that assignee should have valid email address. 3. save the case. 4. email is received without contact and and case number. #### Context <!--- How has this bug affected you? What were you trying to accomplish? --> <!--- If you feel this should be a low/medium/high priority then please state so --> #### Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * SuiteCRM Version used: 7.4.3 * Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Google Chrome 123.0.6312.86 (Official Build) (32-bit) * Environment name and version (e.g. MySQL, PHP 7): MariaDB : 5.5.5-10.1.21, PHP 5.3 * Operating System and version (e.g Ubuntu 16.04):Windows 32 Bit
Author
Owner

@chris001 commented on GitHub (Apr 3, 2024):

@ebsi-RBakade Would you make a new Pull Request (referencing this Issue number) with the edited file, for review, test, and if approved, add to app.

@chris001 commented on GitHub (Apr 3, 2024): @ebsi-RBakade Would you make a new Pull Request (referencing this Issue number) with the edited file, for review, test, and if approved, add to app.
Author
Owner

@ebsi-RBakade commented on GitHub (Apr 4, 2024):

@chris001
I have reopened this Bug. Please take a look.

@ebsi-RBakade commented on GitHub (Apr 4, 2024): @chris001 I have reopened this Bug. Please take a look.
Author
Owner

@johnM2401 commented on GitHub (Apr 9, 2024):

Hey @ebsi-RBakade !
Thank you for getting in touch!

I've given this a try on the latest version, with:
SuiteCRM 7.14.3
PHP 8.2

and this appears to be working as expected.

Have I perhaps missed something in replication?

I'm attempting:

  • Create a new Case
  • Assign it to a user other than myself
  • See that the user recieves an Email
    My selected user does get the assignment mail:
    image
    image

I see from your issue that you're using SuiteCRM 7.4.3 and PHP 5.3
Is this correct?
If so, would you be able to try on a more recent version of SuiteCRM & supported PHP version and let us know if you are still able to replicate this issue?


You also mention:
"email is received without contact and and case number."
However, I don't believe the OOTB Record Assignment Email contains this information. (See screenshot above)
Do you perhaps have a custom assignment template?
Or are you referring to another feature?

Thanks!

@johnM2401 commented on GitHub (Apr 9, 2024): Hey @ebsi-RBakade ! Thank you for getting in touch! I've given this a try on the latest version, with: SuiteCRM 7.14.3 PHP 8.2 and this appears to be working as expected. Have I perhaps missed something in replication? I'm attempting: - Create a new Case - Assign it to a user other than myself - See that the user recieves an Email My selected user *does* get the assignment mail: ![image](https://github.com/salesagility/SuiteCRM/assets/13675281/3ca5f65e-4ad8-4e20-b18e-e613818ed21f) ![image](https://github.com/salesagility/SuiteCRM/assets/13675281/8de3ad1c-1ad5-46c2-a6a2-0e7b89b68342) <br> I see from your issue that you're using SuiteCRM 7.4.3 and PHP 5.3 Is this correct? If so, would you be able to try on a more recent version of SuiteCRM & supported PHP version and let us know if you are still able to replicate this issue? <br> You also mention: "email is received without contact and and case number." However, I don't believe the OOTB Record Assignment Email contains this information. (See screenshot above) Do you perhaps have a custom assignment template? Or are you referring to another feature? Thanks!
Author
Owner

@ebsi-RBakade commented on GitHub (Apr 17, 2024):

@johnM2401
thanks for that Input. I confirmed that contact name and case number are the custom field added in the email template at data/SugarBean.php file inside create_notification_email() function.

@ebsi-RBakade commented on GitHub (Apr 17, 2024): @johnM2401 thanks for that Input. I confirmed that **contact name and case number** are the custom field added in the email template at data/SugarBean.php file inside create_notification_email() function.
Author
Owner

@SuiteBot commented on GitHub (May 28, 2024):

This issue has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/add-case-number-to-case-assignment-email/52103/18

@SuiteBot commented on GitHub (May 28, 2024): This issue has been mentioned on **SuiteCRM**. There might be relevant details there: https://community.suitecrm.com/t/add-case-number-to-case-assignment-email/52103/18
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#5181
No description provided.