joomla mailto component

My developer has developed this new page on my new joomla site (www.tedpenner.com/fwdindex).  We are working on fixing what happens when you press the forward to friend button which uses the mailto component.

cwg says: in other words, we want to change the content of email sent from the site when the email icon is clicked by a user.

The unwanted result is below.  I want to format the email such that all it displays is a "link" containing the title of the article and nothing more.  Ideally, I'd like the sender to be able to edit the existing outgoing message containing this link as well, and be able to do this from inside the same dialog where they put the users email address.

Unwanted Result:
This is an e-mail from (tedpenner.com) sent by name of fwd sender (senders@email.com). You may also find the following link interesting: http://www.tedpenner.com/fwdindex?view=article&id=22%3Apastor-fluff 

cwg says: I'm modifying the code in the mailto component's controller.php to create a prettier email. I tried 4 different sharing or email extensions to joomla and none of them had this functionality so I have resorted to changing core which I really don't like to do. Right now I'm having a hard time figuring out how to get the title of the article, and once I solve that I need to figure out how to make it into a pretty link. Any suggestions appreciated muchly.
rtod2Asked:
Who is Participating?
 
rtod2Author Commented:
The concept: Create an index page andarticle pages for each of a group of articles that are suitable forforwarding to friends.  The project was implemented as part ofan existing joomla site, tedpenner.com at /fwdindex.
  • A new section and category were      created, each with the name 'forwards'.
          
  • Alphacontent extension was used to      create the index page.
          
  • The following customizations were      made:
          
    • components/com_mailto
                  
      • controller.php                  was modified to create a 'prettier' email. This required getting                  an additional hidden form item: title.
                          
      • views/mailto/tmpl/default.php                  was modified to handle the new form item, title. It was set to                  copy the 'link' to 'title' in the case where title was not                  initialized.
                          
      • view/mailto/view.html.php                  was modified to initialize the new form item from the newly                  redefined url request. (&title=xxxx added to url)
                    
                 
    • components/com_alphacontent
                  
      • views/alphacontent/tmpl/default.php                  was modified to create a special 'forward to friend' link next to                  each article being indexed. The url associated with the link has                  the title of the article as well as a link to the actual article,                  not to the index page.
                    
                 
    • components/com_content
                  
      • helpers/icon.php                  was modified to detect the 'forwards section' and treat it as a                  special case. For that section a special 'backlink' to the index                  page is created, and a special version of the email link is                  generated, using a fancy 'forward' button and with the special url                  that has title as well as link to the current page.
                    
           
The title and link arguments passed viaurl are encoded in base64.
0
 
pekaboCommented:
Open the file controller.php in components/com_mailto

search for:
// Build the message to send
            $msg      = JText :: _('EMAIL_MSG');
            $body      = sprintf( $msg, $SiteName, $sender, $from, $link);

Change it to:
// Build the message to send
            $msg      = JText :: _('EMAIL_MSG');
            $body      = sprintf( $link);

In the email you will find now only the Link to the article
0
 
rtod2Author Commented:
CWG says:

Pekabo, I've gone way past that already, as I think my editing of Ted's initial request might have told you. I've got a new, nicely formatted email message now, once i figured out how to do the line breaks using sprintf. BUT I can't figure out where to get the TITLE that is associated with the linked message. I spent several hours on this yesterday looking for a way to use the link in order to get the title. but so far I have gotten nowhere. I'm pretty sure I know how to extract the url part of the existing link and use that plus the title to make a nice looking link for the email.

If I hadn't already identified the file that constructed the message your tip might have been helpful, but I had included that information in the original question. Clearly we need more help--specifically, how, from the context of the mailto component, can I get the title of the article that is being sent? Thanks.
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
pekaboCommented:
maybee this will help
$params->get( 'page_title')
0
 
rtod2Author Commented:
cwg says: That's the idea for what I want. Unfortunately that just makes the routine go away...without sending email. Probably there is no appropriate context for $params inside the component's controller...

something else i tried, that also failed, was:
$doc      =& JFactory::getDocument();
$title=$doc->$title;

also, note that $link is set by:
$link             = base64_decode( JRequest::getVar( 'link', '', 'post', 'base64' ) );

so I tried
$title= JRequest::getVar ('title', '', 'post', 'text');

That didn't work either. Thanks--hope you'll spot something.
0
 
rtod2Author Commented:
We need to write-up our solution here.  This was incredibly hard to do.  We finally got it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.