Twitter
Tue
30
Jun
'09
PDF
Print
Send
 
Hits (1722) | Comments (1) | Favorited (0) | Votes (0)

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
additions[0][url]=http://joomla/index.php/en/inbox.html
additions[0][id]=120
additions[0][text]=sometext

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
sto[0][name]=AndrewStrauss
sto[1][to]=Felix
sto[1][name]=Volodya Cheskidov

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);

Comments
jacques_vAvatar
Quote
- -
Written by jacques_v VIP on 18 August 2009

Great!   I'm using it for"inappropriate content" reporting by users in articles and comments.

(However, you should create an InBox category in the Developper's center and piut it in, I didn't find this API doc and was ready to ask a question in the support forum Embarassed )

Regards, Jacques

-
Add New Comment
Name:
Email:
Comment:
Attachment
Hide Comment
Security code:
Enter text as you see on image
 
 
What is best way for Download/Installation MightyExtensions?
 


Member Area



Member Activity

We have 2024 guests and 8 members online


MightyTemplate - Professional Joomla Templates