Adding Mail Compose Block to Profile

How would I go about adding a compose message form to the users profile page?

Quote · 12 Sep 2012

Any ideas?

 

Do I need to do a service call?

Quote · 17 Sep 2012

 Hello

Any ideas?

 

Do I need to do a service call?

You cannot use Service Call because mailbox is not a module. It's a system feature. So, you need to create a PHP block and call getBlockCode_ComposeMessage function from templates/base/scripts/BxBaseMailBox.php file. The code should looks like the following

$aMailBoxSettings = array (
'member_id' => $this->oProfileGen->_iProfileID
);
bx_import('BxTemplMailBox');
$oMailBox = new BxTemplMailBox('mail_page_compose', $aMailBoxSettings);

$GLOBALS['oSysTemplate']->addCss(array('mail.css'));
$GLOBALS['oSysTemplate']->addJs(array('mail_box.js'));
return $oMailBox->getBlockCode_ComposeMessage();

Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV
Quote · 17 Sep 2012

Fantastic, many thanks AntonLV.

For any others with a similar problem, use Anton's code above but add this:

 

$aMailBoxSettings = array (
'member_id' => $this->oProfileGen->_iProfileID,

'recipient_id' => $this->oProfileGen->_iProfileID
);

Quote · 19 Sep 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.