• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Mail results instead of saving to database

Mail results instead of saving to database 16 years 1 month ago #6849

  • rima
  • rima's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Fist let me say thank you for a great component, wich potential I still dont use to the max.

Sorry if this is already answered before but I couldnt find it.

Is it possible that when someone submits my form that the results are mailed to one of my employees instead of being saved in the database? Because not everyone has access to the website I would like the results to be mailed.

Best regards
Rik
The administrator has disabled public write access.

Re:Mail results instead of saving to database 16 years 1 month ago #6870

  • zoomyman
  • zoomyman's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hello.
Please note this solution will not disable the storing (submition) of the data into the database. It will only add the e-mail function on top of it's normal functionality.

You could try this...

1. In your RS Form admin panel go to Forms manager and choose the form you like to modify. Click the "Emails" tab and make sure the "Email Form data to:" has got at least your email address (I also use {EmailAddress} to send the submitter a confirmation e-mail). In my case there are: myemail@mail.com,{EmailAddress}. The {EmailAddress} variable is used by me, yours might be different.

2. Also make sure the submiter will get the e-mail from your business web site to make him feel confident. I my case it is: This e-mail address is being protected from spambots. You need JavaScript enabled to view it

3. "Email From Name:" and "Email Subject:" are up to you.

4. I prefer to use "Email Mode(Text/HTML):" Text.

5. And finally the first of two most inportant parts is this. This is an example of my code in a "Email Text:" field
Thank you for your visit, your submission has been registered. Here's a copy:
 
Fullname: {FullName}
 
Business Name: {BusinessName}
 
Business Type: {BusinessType}
 
Daytime Tel: {DaytimeTel}
 
Best Time To Call: {BestTimeToCall}
 
Email: {EmailAddress}
 
Address: {Address}, {addressfield2}, {addressfield3}
 
Postcode : {Postcode}
 
- - -  
 
How can we Help?: {HowCanWeHelp}
 
Services you are interested in: {ServicesInterestedIn},{services1}
 
- - -  
 
How did you hear about us?: {HowDidYouHear}
 
 
Best regards, Taxreturns4you.co.uk

Take a look carefully at this as an example: Fullname: {FullName} . The red part is the text of your choice, but the dark blue part must have the same name as the "Field Id".
6. And the last step of your setup would be this one. Click on Scripts and fill the "Script called on form process" field with this:
if(isset($_POST['form']['test'])){
$fp = fopen($RSadapter->config['absolute_path'].'/components/com_rsform/uploads/test.txt', 'w');
$str = '';
foreach($_POST['form'] as $component=>$value){
if(is_array($value)) $value = implode(',',$value);
$str.=$component.'='.$value."\r\n";
}
fwrite($fp, $str);
fclose($fp);
$adminEmail['files'][] = $RSadapter->config['absolute_path'].'/components/com_rsform/uploads/test.txt';
}

Also make shure the folder "uploads" in "/components/com_rsform/" of your Joomla installation has got the "777" access level.

Hope it helps B)
Last Edit: 16 years 1 month ago by zoomyman.
The administrator has disabled public write access.

Re:Mail results instead of saving to database 16 years 1 month ago #6958

  • s31523
  • s31523's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 25
How would I modify this code to simply same the form as a .csv file, much like the back-end admin control panel does? I want the form to be "saved" from the frontend... Thanks!
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!