• 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: Different email responses according to dropdown

Different email responses according to dropdown 4 years 1 month ago #41074

  • harry8
  • harry8's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Hi everyone,

I have been struggling with this so thought I would ask here...

Basically what I am trying to do is have a form that, apart from normal fields like Name, Email, Comment etc., has a single dropdown item containing 3 options:

Example Dropdown options:

Free Sample of product 1
Free Sample of product 2
Free Sample of product 3

When the user submits that form I then want RSForm!Pro to choose from 3 emails and send according to the selection from the dropdown...

So then I would want 3 emails setup with titles like:

Thank you for requesting your Free Sample of product 1 etc., etc...
Thank you for requesting your Free Sample of product 2 etc., etc...
Thank you for requesting your Free Sample of product 3 etc., etc...

So someone that selected "Free Sample of product 1" - would then receive the email titled "Thank you for requesting your Free Sample of product 1"
So someone that selected "Free Sample of product 2" - would then receive the email titled "Thank you for requesting your Free Sample of product 2"
etc., etc.

But so far haven't been able to work it out - so before I go to the lengths of creating 3 separate forms to achieve the same result I thought I would check here first...

Many thanks
Harry
The administrator has disabled public write access.

Different email responses according to dropdown 4 years 1 month ago #41076

  • dragos
  • dragos's Avatar
  • OFFLINE
  • Administrator
  • Posts: 634
  • Thank you received: 117
Hello,

A specialized {if} syntax can be used so that you show information based on selections/values, you can read more about this topic here.
The administrator has disabled public write access.

Different email responses according to dropdown 4 years 4 weeks ago #41099

Hi, you can use script bellow before email is sent ($directoryEmail ) .

At this example, after select text1 no email is sent and after select text2 a custom email is sent. You can create as many custom emails you want after each 'elseif'


if($_POST[0] == 'text1){
$directoryEmail='';

}else if($_POST[0] == 'text2'){
$directoryEmail=' This e-mail address is being protected from spambots. You need JavaScript enabled to view it ';
$directoryEmail='Name tou want';
$directoryEmail = 'My_subject_for_text2' ;

$modEmailText = $form->AdminEmailText;

$modEmailText .= '
<h3 style="text-align: center;"><span style="color: #800000;"><strong>Title of My emai lbody</strong></span></h3>
<p><span style="color: #3366ff;"><strong>field1:</strong></span> {field1:value}</p>
<p><span style="color: #3366ff;"><strong>field2:</strong></span> {field2:value}</p>
<p><span style="color: #3366ff;"><strong>field3:</strong></span> {field3:value}</p>
';

$directoryEmail = $modEmailText;

$directoryEmail = str_replace($placeholders, $values, $directoryEmail);

;
The administrator has disabled public write access.
The following user(s) said Thank You: harry8
  • 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!