I have been trying to figure this out for 2 weeks to no avail.
Each user on my site has a page, and I want to add a form where guests can send the user an email. I want to use Chronforms instead of Joomla contact form for obvious reasons... so much better.
I am using Joomla 3.1
URL Structure is: mydomain.com/username1, mydomain.com/username2, etc.
I saw the post on here http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=21710, but that did not seem to work. Maybe due to it being from 2011. I get error: You must provide at least one recipient email address. The form works fine if I set Static To value
Dynamic To is set to a hidden box field ptm_mail
This is the code I run OnSuccess (inside CheckCaptcha):
NOTE: I have id set to 921 just for testing to see if it can pull that user's email address. Figuring out how to get the real user id for the page is the other issue.
Appreciate your help! Thanks:)
Each user on my site has a page, and I want to add a form where guests can send the user an email. I want to use Chronforms instead of Joomla contact form for obvious reasons... so much better.
I am using Joomla 3.1
URL Structure is: mydomain.com/username1, mydomain.com/username2, etc.
I saw the post on here http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=21710, but that did not seem to work. Maybe due to it being from 2011. I get error: You must provide at least one recipient email address. The form works fine if I set Static To value
Dynamic To is set to a hidden box field ptm_mail
This is the code I run OnSuccess (inside CheckCaptcha):
<?php
$db =& JFactory::getDBO();
$query = "
SELECT `email`
FROM `#__users`
WHERE `id` = '921' ;
";
$db->setQuery($query);
$email = $db->loadResult();
JRequest::setVar('ptm_email', $email);
?>
NOTE: I have id set to 921 just for testing to see if it can pull that user's email address. Figuring out how to get the real user id for the page is the other issue.
Appreciate your help! Thanks:)