Take a look at How can I generate an admin link from a frontend controller?
Short answer: you can't, but if you create a admin controller that will act like a proxy to get the url key then do the redirect (since you can disable the validation of admin url using $_publicActions
).
class MagePal_ProxyCustomerRedirect_Adminhtml_RedirectController extends Mage_Adminhtml_Controller_Action
{
/**
* Array of actions which can be processed without secret key validation
*
* @var array
*/
protected $_publicActions = array('redirecttocustomer');
public function redirecttocustomerAction()
{
// get the customer id pass by your observer (url key)
Mage::app()->getResponse()->setRedirect(Mage::helper("adminhtml")->getUrl("adminhtml/customer/edit/", array("id"=>$customer_id)));
In your observer
Mage::app()->getResponse()->setRedirect(Mage::helper("adminhtml")->getUrl("adminhtml/redirecttocustomer/edit/", array("id"=>$customer_id)));
See Mage_Adminhtml_Controller_Action
protected function _validateSecretKey()
{
if (is_array($this->_publicActions) && in_array($this->getRequest()->getActionName(), $this->_publicActions)) {
return true;
}
if (!($secretKey = $this->getRequest()->getParam(Mage_Adminhtml_Model_Url::SECRET_KEY_PARAM_NAME, null))
|| $secretKey != Mage::getSingleton('adminhtml/url')->getSecretKey()) {
return false;
}
return true;
}