Incredible simple solution.
PLEASE INTEGRATE THIS INTO THE DOWNLOAD PACKAGE.
Step 1:
EDIT /oc-includes/osclass/ItemActions.php
put this code:
/**
* Return an array with all data necessary for do the action
* @param <type> $action
*/
private function prepareDataForFunction( $action )
{
$aItem = array();
switch ( $action ){
case 'send_friend':
$item = $this->manager->findByPrimaryKey( Params::getParam('id') );
if ($item===false || !is_array($item) || count($item)==0)
break;
$aItem['item'] = $item;
View::newInstance()->_exportVariableToView('item', $aItem['item']);
$aItem['yourName'] = Params::getParam('yourName');
$aItem['yourEmail'] = Params::getParam('yourEmail');
$aItem['friendName'] = Params::getParam('friendName');
$aItem['friendEmail'] = Params::getParam('friendEmail');
$aItem['s_title'] = $item['s_title'];
$aItem['message'] = Params::getParam('message');
$aItem['subject'] = Params::getParam('subject');
break;
instead of this
/**
* Return an array with all data necessary for do the action
* @param <type> $action
*/
private function prepareDataForFunction( $action )
{
$aItem = array();
switch ( $action ){
case 'send_friend':
$item = $this->manager->findByPrimaryKey( Params::getParam('id') );
if ($item===false || !is_array($item) || count($item)==0)
break;
$aItem['item'] = $item;
View::newInstance()->_exportVariableToView('item', $aItem['item']);
$aItem['yourName'] = Params::getParam('yourName');
$aItem['yourEmail'] = Params::getParam('yourEmail');
$aItem['friendName'] = Params::getParam('friendName');
$aItem['friendEmail'] = Params::getParam('friendEmail');
$aItem['s_title'] = $item['s_title'];
$aItem['message'] = Params::getParam('message');
break;
Step 2.
oc-includes/osclass/emails.php
put this code:
function fn_email_send_friend($aItem) {
$mPages = new Page();
$aPage = $mPages->findByInternalName('email_send_friend');
$locale = osc_current_user_locale();
if(isset($aPage['locale'][$locale]['s_title'])) {
$content = $aPage['locale'][$locale];
} else {
$content = current($aPage['locale']);
}
$item_url = osc_item_url();
$item_url = '<a href="'.$item_url.'" >'.$item_url.'</a>';
$words = array();
$words[] = array(
'{FRIEND_NAME}',
'{USER_NAME}',
'{USER_EMAIL}',
'{FRIEND_EMAIL}',
'{ITEM_TITLE}',
'{COMMENT}',
'{ITEM_URL}',
'{ITEM_LINK}',
'{SUBJECT}'
);
$words[] = array(
$aItem['friendName'],
$aItem['yourName'],
$aItem['yourEmail'],
$aItem['friendEmail'],
removeunderline($aItem['s_title']),
$aItem['message'],
osc_item_url(),
$item_url,
$aItem['subject']
);
instead of:
function fn_email_send_friend($aItem) {
$mPages = new Page();
$aPage = $mPages->findByInternalName('email_send_friend');
$locale = osc_current_user_locale();
if(isset($aPage['locale'][$locale]['s_title'])) {
$content = $aPage['locale'][$locale];
} else {
$content = current($aPage['locale']);
}
$item_url = osc_item_url();
$item_url = '<a href="'.$item_url.'" >'.$item_url.'</a>';
$words = array();
$words[] = array(
'{FRIEND_NAME}',
'{USER_NAME}',
'{USER_EMAIL}',
'{FRIEND_EMAIL}',
'{ITEM_TITLE}',
'{COMMENT}',
'{ITEM_URL}',
'{ITEM_LINK}'
);
$words[] = array(
$aItem['friendName'],
$aItem['yourName'],
$aItem['yourEmail'],
$aItem['friendEmail'],
removeunderline($aItem['s_title']),
$aItem['message'],
osc_item_url(),
$item_url
);
Step 3
/oc-includes/osclass/classes/EmailVariables.php
Add this code
),'email_send_friend' => array(
'{FRIEND_NAME}',
'{USER_NAME}',
'{USER_EMAIL}',
'{FRIEND_EMAIL}',
'{ITEM_TITLE}',
'{COMMENT}',
'{ITEM_URL}',
'{ITEM_LINK}',
'{SUBJECT}'
instead of:
),'email_send_friend' => array(
'{FRIEND_NAME}',
'{USER_NAME}',
'{USER_EMAIL}',
'{FRIEND_EMAIL}',
'{ITEM_TITLE}',
'{COMMENT}',
'{ITEM_URL}',
'{ITEM_LINK}'
Final step: Edit email_send_friend in admin area so it includes the {SUBJECT}