Auto responder

Shows some Tutorials

Auto responder

Postby hans8020 on Thu Jun 05, 2008 1:53 pm

Hello,

I want to create an auto reponse e-mail to the submitter with a simple Thank you message and the filled in data from the form. I read the topics about this and stumbled upon several simmilar problems. There was a link from GreyHead to a topic with the right code for me but the link didn't work. I work with Joomla 1.5 and apparently I needed a different piece of PHP at the end to get it work ...but nada.. This is my code:
Code: Select all
<?php
$recipient = $_POST[Email];
$html_message = "<p>Bedankt voor het invullen van ons contactformulier.
Uw vraag wordt zo spoedig mogelijk behandeld</p>";
$subject = $subject";
JUtility::sendMail( $from, $fromname, $recipient,
    $subject, $html_message, true );
?>


Yes, this will only cover the thank you message and not display the results of the form, but I thought I would start easy on this.... Does any-one have a link to the right topic or code?
hans8020
Fresh Boarder
 
Posts: 6
Joined: Thu Jun 05, 2008 1:21 pm

Re:Auto responder

Postby GreyHead on Thu Jun 05, 2008 2:58 pm

Hi Hans8020,

To send the form data to the submitter you just need to include 'Email' (no quotes) in the box on the Special Fields tab.

To make this a personalised message you need to create an email template in the Form Code tab - and select Email template on the General tab.

To show a thank you page you need to put some HTML in the 'OnSubmit after' box.

You only need to use the code you have posted if you want to send *different* emails to the submitter adn the admin.

Bob

PS If you point me to the broken link I can fix it - probably it's got & instead of & in it somewhere.



You only need to
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3251
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Auto responder

Postby hans8020 on Thu Jun 05, 2008 4:22 pm

Thank you very much! I will find teh broken link and send it to you.
hans8020
Fresh Boarder
 
Posts: 6
Joined: Thu Jun 05, 2008 1:21 pm

Re:Auto responder

Postby hans8020 on Thu Jun 05, 2008 5:37 pm

Hello again,

I wasn't very clear in my question. Yes, I do have to send an e-mail to the e-mail adress of the owner (where the formresults will be processed) and second, a reply to the submitter ..so I do need the php codes to put in the onsubmit after area since the e-mail template will be used for the mail to the owner. I can't find the topic with the broken link but there was someone who solved this problem, so can you help me again?
hans8020
Fresh Boarder
 
Posts: 6
Joined: Thu Jun 05, 2008 1:21 pm

Re:Auto responder

Postby GreyHead on Thu Jun 05, 2008 9:04 pm

Hi hans8020,

OK then the code you have posted looks to me like the correct code to send an email in Joomla 1.5.x???

Please take a Form Backup from the Form Manager and email it to me at the address in my sig and I'll take a look.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3251
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Auto responder

Postby hans8020 on Fri Jun 06, 2008 7:48 am

Thank you for your interest, My joomla version = 1.5.3 Dutch

I will attach the backup. [file name=contact.cfbak size=17467]http://www.chronoengine.com/images/fbfiles/files/contact.cfbak[/file]
hans8020
Fresh Boarder
 
Posts: 6
Joined: Thu Jun 05, 2008 1:21 pm

Re:Auto responder

Postby GreyHead on Fri Jun 06, 2008 9:16 am

Hi Hans,

There were two small typos in your mail code. Here's the revised version:
Code: Select all
<?php

$recipient = $_POST['Email'];  // added quotes round Email

$html_message = "<p>Bedankt voor het invullen van ons contactformulier. 
Uw vraag wordt zo spoedig mogelijk behandeld</p>";

$subject = $subject; // removed " 

JUtility::sendMail( $from, $fromname, $recipient, 
    $subject, $html_message, true );

echo $html_message; // added this line

?>
I've also added a last line which will display the message on the 'Thank You' page. To see this please remove the ReDirect URL.

Bob

PS Something weird with the forums again (or maybe my browser) - I can't get line-breaks to stick :-(
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3251
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Auto responder

Postby hans8020 on Fri Jun 06, 2008 10:54 am

Thanks Bob,

I"ll try this code.

Greetings,

Hans
hans8020
Fresh Boarder
 
Posts: 6
Joined: Thu Jun 05, 2008 1:21 pm

Re:Auto responder

Postby hans8020 on Fri Jun 06, 2008 11:02 am

Hello Bob,

I found the broken link here in your first reply...the link (here) starts the common forum page.

Greetings,

Hans
hans8020
Fresh Boarder
 
Posts: 6
Joined: Thu Jun 05, 2008 1:21 pm

Re:Auto responder

Postby GreyHead on Fri Jun 06, 2008 12:16 pm

Hi Hans,

Fixed thank you.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3251
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany


Return to How To

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests