Ep. 7 - How to send e-mails to recipients listed in a drop-down field
This video tutorial explains how to configure the RSForm!Pro "user and admin emails".
As an example, we have used a simple Joomla! contact form with 5 fields (name, email, message, staff and a submit button )that allows users to send messages to staff members. Users will be able to select from the dropdown the staff member that will receive the message.
Upon form submission, the user receives a personalized e-mail from your company. This e-mail is called "user email" and can be configured in the RSForm!Pro "Manage forms" tab >> "user e-mails" area.
The staff member selected from the drop-down receives an e-mail with the user submitted data. This email is called "admin email" and can be configured in the RSForm!Pro "Manage forms" tab >> "admin emails" area.
Test RSForm!Pro in frontend
Test RSForm!Pro in backend
Video Tutorials Categories
- All Videos 104
- RSBlog! 4
- RSComments! 2
- RSContact! 1
- RSDirectory! 4
- RSEvents!Pro 5
- RSFeedback! 2
- RSFiles! 6
- RSFinder! 1
- RSFirewall! 8
- RSFirewall! for WordPress 0
- RSForm! 1
- RSForm!Pro 26
- RSMail! 5
- RSMediaGallery! 1
- RSMembership! 14
- RSPageBuilder! 0
- RSSearch! 2
- RSSeo! 7
- RSShowcase! 0
- RSSocial! 0
- RSTickets!Pro 4
- Templates 11
Thanks for the key to seeing the list of variables.
QuoteI'll check on leaving from & to empty but I think I received an error message when I tried that.
Hello,
QuoteIf you take a closer look at the PHP Email scripts article, you will notice that it does provide a complete list of the email properties. Further to this, you can simply use a print_r($adminE mail);die(); to see the exact structure for yourself.
You can disable the admin email by simply not specifying a From and To address.
Please disregard my comment about admin email - it was erroneous.
QuoteI have a script to populate the dropdown without emails from a simple csv file. This script is in the "items" values in the dropdown options. I also have a script which converts the dropdown selection into the associated email. This is in the "after post before before send" form-script area. My issue now is that I need to modify the mail "to" value (as well as cc and bcc). I have seen vague references to it in the tutorials but nothing specific about field-names, how/when/what the intepreter does with an override, etc.
I also wish there was an option to Not send an email to the admin. That though is a function request.
Thanks
@Mike
This is why the scripting method is suggested as an alternate. Thus the recipients won't be displayed within the frontend - thus being protected from spam bots.
QuoteI am not quite sure i understand your reference to admin email. Can you please explain further ?
If you are trying to hide emails from scrapers and bots, do NOT use the methods suggested here. As soon as you enter an email address into any selectable item-pair, the email is exposed in the html. As far as I know, there is no built-in function to match a selected form-value to an "admin-email" value. BTW, "admin-email" is a complete misnomer for the standard email "to:" field.
QuoteIf there would be an article for each "issue" there wouldn't be any issues, isn't it ? You are more then welcome to post your inquiry to the forum and see if anyone can help.Quote
populating dropdown from csv
$POST does not fill the dropdown with values. I tried to ask support but my site is covered under a site license through a "mother" site and I have no access to the license key. I'm not asking for a tutorial on php but your articles do not address my issue.
QuoteThanks
populate dropdown
I have a small csv file, ~12 lines; each line contains 2 fields:
Quoteoffice, office@us.com
president, president@us.com
finances,treasu rer@us.com
I can successfully read/parse through the data but I cannot populate the dropdown. I must be missing something simple. code is below which is in "Script called on form display". Thanks
//
$handle = fopen("/home/em/em.csv", "r");
if ($handle) {
while (($data = fgetcsv($handle , 4096, ",")) !== FALSE) {
$_POST['form']['cf_recipient'][0] = $data[0];
}
fclose($handle) ;
}
else
{
echo "Error: Unable to open file\n";
}
//
The $_POST array will only contain the submitted value. If a dropdown is used, then it will contain a single value, indexed 0.
QuotePS: If you are having problems in implementing this, please submit a support ticket:
http://www.rsjoomla.com/support.html
Thanks for the link - it helped a bit. But, the example to get a selected drop-down value works only on a single selection = [0]. Is the original drop-down array replaced with only what has been selected? If so, I can merely loop through the new array and concat the data into the mailto variable. If not, how do I tell the difference between selected cvalue and non-selected ones?
ThanksQuote