File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -340,11 +340,18 @@ public function saveAction()
340340 }
341341
342342 try {
343- $ admin = Mage::getModel ('zendesk/api_users ' )->me ();
343+ $ admin = Mage::getSingleton ('admin/session ' )->getUser ();
344+ $ submitter = Mage::getModel ('zendesk/api_users ' )->find ($ admin ->getEmail ());
345+
346+ if (!$ submitter ) {
347+ // Default to the user set in the agent email field under Configuration
348+ $ submitter = Mage::getModel ('zendesk/api_users ' )->me ();
349+ }
350+
344351 $ ticket = array (
345352 'ticket ' => array (
346353 'requester_id ' => $ requesterId ,
347- 'submitter_id ' => $ admin ['id ' ],
354+ 'submitter_id ' => $ submitter ['id ' ],
348355 'subject ' => $ data ['subject ' ],
349356 'status ' => $ data ['status ' ],
350357 'priority ' => $ data ['priority ' ],
You can’t perform that action at this time.
0 commit comments