• 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: Send confirmation mail

Send confirmation mail 2 years 6 months ago #41597

I would like to send a mail to user and admin after confirmation

Like this: www.rsjoomla.com/support/documentation/r...on-confirmation.html

But the content of the "confirmation" mail should be different than the one of the "submission" mail.

Workflow:
1) User submits form
2) User and admin receive their respective mails as usual
3) Admin clicks link to confirm it
4) User and admin receive a different mail

Is there a way to achieve this, perhaps with some < if > trickery in the mail content?

Btw: Would be nice to be able to enable confirmation mail and edit its content separately in the user/admin mail settings.

Thanks.
The administrator has disabled public write access.

Send confirmation mail 2 years 5 months ago #41650

Basic instructions are here: www.rsjoomla.com/support/documentation/r...on-confirmation.html

In order to achieve what I need, the following modifications have to be made:

1) Create custom link and add to admin e-mail
Enable the "Enable Confirmation By Email" option in form properties.
Add a registration code element (or support ticket placeholder, the name seems to have changed).
Add the custom link to the admin e-mail body, replace form id and registrationcode with your own form id and whatever you named the registration code element:

UrlOfYourWebsite.com/index.php?option=com_rsform&formId=12&subId={global:submissionid}&hash={YourRegistrationCodeName:value}

2) Add php to "Scripts called on form Display"
replace the registration code name with your own:
          //replace the Registration Code name with the one you've given:
          $RegCodeVariable = "YourRegistrationCodeName";
 
          //getting parameter values:
          $app = JFactory::getApplication();
          $sid = $app->input->getInt('subId');
          $hash = $app->input->getVar('hash');
 
          //checking if parameters are available:
          if(!empty($sid) && !empty($hash)){
 
            $db = JFactory::getDBO();
            $db->setQuery("SELECT `FieldValue` FROM #__rsform_submission_values WHERE `FieldName`='".$RegCodeVariable."' AND `SubmissionId` = '".$sid."'");
            //checking if the hash matched the submission ID:
            if(!empty($db->loadResult())){
 
              //This confirms the submission:
              $db->setQuery("UPDATE `#__rsform_submissions` SET `confirmed` = 1 WHERE `SubmissionId` = '".$sid."'");
              $db->execute();
 
              //Confirmation message shown after clicking the custom link:
              $formLayout = "<p>Add your own message here.</p>";
 
              //the following triggers your form's emails:
              RSFormProHelper::sendSubmissionEmails($sid);
            }
          }

3) Add php e-mail scripts
This prevents the user- and admin e-mails from being sent but will trigger the additional e-mails.

Script called before the User Email is sent:
          if(!isset($_POST['form'])){
          $userEmail['to'] = '';
          }

Script called before the Admin Email is sent:
          if(!isset($_POST['form'])){
          $adminEmail['to'] = '';
          }

Script called before the Additional Email are sent:
          if(isset($_POST['form'])){
          $additionalEmail['to'] = '';
          }

4) Add the additional e-mails
These are the confirmation mails, which are sent after the submission has been confirmed.
In my case one is sent to user and one to admin.
Last Edit: 2 years 5 months ago by office424.
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!