Index: trunk/kernel/include/parseditem.php
===================================================================
diff -u -r6093 -r7867
--- trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 6093)
+++ trunk/kernel/include/parseditem.php (.../parseditem.php) (revision 7867)
@@ -606,42 +606,24 @@
return $html;
}
+ /**
+ * Sends EmailEvent to user
+ *
+ * @param string $EventName email event name
+ * @param mixed $ToUserId recipient's user_id or email address
+ * @param int $LangId language_id (not in use)
+ * @param string $RecptName recipient's name (only when ID not passed)
+ * @return kEvent
+ */
function SendUserEventMail($EventName,$ToUserId,$LangId=NULL,$RecptName=NULL)
{
- global $objMessageList,$FrontEnd;
-
- $Event =& $objMessageList->GetEmailEventObject($EventName,0,$LangId);
-
- if(is_object($Event))
- {
- if($Event->Get("Enabled")=="1" || ($Event->Get("Enabled")==2 && $FrontEnd))
- {
- $Event->Item = $this;
- if(is_numeric($ToUserId))
- {
- return $Event->SendToUser($ToUserId);
- }
- else
- return $Event->SendToAddress($ToUserId,$RecptName);
- }
- }
+ $send_params = is_numeric($ToUserId) ? Array() : Array ('to_email' => $ToUserId, 'to_name' => $RecptName);
+ return $this->Application->EmailEventUser($EventName, $ToUserId, $send_params);
}
function SendAdminEventMail($EventName,$LangId=NULL)
{
- global $objMessageList,$FrontEnd;
-
- //echo "Firing Admin Event $EventName
\n";
- $Event =& $objMessageList->GetEmailEventObject($EventName,1,$LangId);
- if(is_object($Event))
- {
- if($Event->Get("Enabled")=="1" || ($Event->Get("Enabled")==2 && $FrontEnd))
- {
- $Event->Item = $this;
- //echo "Admin Event $EventName Enabled
\n";
- return $Event->SendAdmin($ToUserId);
- }
- }
+ return $this->Application->EmailEventAdmin($EventName);
}
function parse_template($t)