You can easily send user to Inbox compose mesage page and controll what page to return after message is sent. Here is the table of the possible parameters.
Send URL: index.php?option=com_jsinbox&task=compose
| Variable | Type | Exampl | Description |
| return | String | base64 encoded url to return to after message is send | |
| type_id | Int | 1 | ID of the type created in type manager in backend |
| subject | String | Subject of the message | |
| to | String | admin, Felix | User name or names separated by coma to whom message should sent |
| cc | String | Jenya | User name or names separated by coma to the copy will be sent |
| bcc | String | Azamat | User name or names separated by coma to the hidden copy will be sent |
| additions | Array |
Addition allow to attach content page of any component to the message. It takes to level array indexes. first level is an number of the attachnebt and second level attachment data. additions[0][title]=title |
|
| sto | Array |
This is used as an alternative of the 'To' field. If the 'sto' parameter is used, then the 'To' field is hidden in the message. It is like sending message to a particular user and not allow the person to change the 'To' field. Recipient who is added at parameter sto [0][to], is not able to see other recipients. However, recipients who get usual copy of the message can see other recipients as well as generic e-mail fields. sto[0][to]=admin |
Here is the example code how you can use it. Let's say we want send product iquiry. The product it is and article in Content. You want to send it to autor of the content and do not want user may change whom it is sent. So you need attache article to message too that author quickly understand regarding what article this message is about.
$uri = JFactory::getURI(); $author = JFactory::getUser($article->author_id); $url = "index.php?option=com_jsinbox&task=compose"; $url .= "&Itemid=".JRequest::getInt('Itemid'); $url .= "&return=".base64_encode($uri->toString()); $url .= "&subject=".JText::_('Product inquiry'); $url .= "&sto[0][to]=".$author->get('username'); $url .= "&sto[0][name]=".$author->get('name'); $url .= "&additions[0][title]=".$article->title; $url .= "&additions[0][url]=".JURI::root(). 'index.php?option=com_article&view=article&id='.$article->id; $url .= "&additions[0][id]=".$article->id; $mainframe->redirect($url);
on
)
+1 (209) 800 1209