Forums

URL in email

kardana 09 Jun, 2010
Hello. The site that I am working on is a Hawaii Activity Website. Each category has multiple articles describing each activity in that category. I have a form created that I want to insert after each article (each article is on its own page). The form is a short book-it request form and I need to have either the article ID number (or name) returned in the email or the URL Of the current page the user is on when they filled out the form. I followed instructions on previous posts but can only seem to have the category ID returned rather than the actual article ID. I'm wondering if there is a way to have the URL (or article ID) included in the email. I need to have a way of determining which article the user is interested in booking.

Mahalo for any assistance!!
kardana 11 Jun, 2010
No answer yet but I was able to get the title of the page in the email. I initially had more than one article on a page so I changed the layout to have a small blurb and then inserted a "read more" and at the end of each article I put the form. I added this code that I found on the another forum question at the end of the form HTML code.

<?php
if ( !$mainframe->isSite() ) { return; }
$doc =& JFactory::getDocument();
//echo '<div>$doc->title :'.print_r($doc->title, true).'</div>';
?>
<input type="hidden" name="title" value='<?=$doc->title?>' />


It works..the title appears in the email. I also added {title} to the email template.

I hope this helps you!
Karen
kardana 11 Jun, 2010
I'm stumbling along here not really knowing what I'm doing and learning by trial and error. The fact that I was able to help someone else makes my day! 😀
Karen
jeremiahkn 14 Jun, 2010
hey it works for me too, thanks for posting the codes man!
adelrami 21 Aug, 2010
Ok, super, however i am getting the cateogiry title not the article title!!! help plz, also its important to include {title} in the email template else it doesnt work. thanks all, ans appreciate helping me solve the category title issue.
kardana 22 Aug, 2010
I found that I had to separate my articles on different pages using the "read more" feature to make this work. Hope that helps!
Karen
GreyHead 22 Aug, 2010
Hi adelrami,

Yes kardana is correct, you can only get a Article title if you are on an Article page. You can't do that from a page with multiple articles or posts on it.

Once you have the article ID you can look up all the info about it in the jos_content table.

Bob
This topic is locked and no more replies can be posted.