I'm hoping someone can help me out here.
I have written my own module to take some data from a form and email it.
The form is part of the template. In the template I use {cms_module module="EmailComments"}. I started the form using echo $this->CreateFormStart($id, 'sendemail', $return_id); in the module.
When the form is submitted, I want it to print some text where I put {cms_module module="EmailComments"} in the template. This bit works. The trouble I'm having is it also prints the text where {content} is, and I want it to display the content that the user was viewing.
The code I have in the module is this:
Code: Select all
function DoAction($name, $id, $params, $return_id='')
{
$db = $this->cms->db;
echo $this->CreateFormStart($id, 'sendemail', $return_id);
switch ($name)
{
case 'sendemail':
echo "<p style=\"font-size: x-small; color: red;\">Thank you. Your message has been sent.</p>";
//mail("emailaddresshere", "Email form", "From: $email\n\nComments: $comments");
}
}Can anyone help me to get it to return the content of the page the user was on, instead of printing the output of the module where {content} was?
Thanks very much.

