salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.5k stars 2.09k forks source link

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

Open ebsi-RBakade opened 7 months ago

ebsi-RBakade commented 7 months ago

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

chris001 commented 7 months ago

@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.

ebsi-RBakade commented 7 months ago

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

johnM2401 commented 6 months ago

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:


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!

ebsi-RBakade commented 6 months ago

@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.

SuiteBot commented 5 months ago

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