• 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: Custom scripting / additional check

Custom scripting / additional check 3 years 7 months ago #41560

Found out how to refine the feature of the deferred emails described here (www.rsjoomla.com/support/documentation/r...on-confirmation.html).

Issue: A confirmation link or button can/will be clicked through a user many times, always triggering the admin/additional emails.

Solution:
$app = JFactory::getApplication();
$sid = $app->input->getInt('subId');
$hash = $app->input->getVar('hash');
$supportTicket = "support";
 
$db = JFactory::getDBO();
$db->setQuery("SELECT `confirmed` FROM #__rsform_submissions WHERE `SubmissionId` = '".$sid."'");
$confirmed = $db->loadResult();
if(($confirmed) == 1){$formLayout = "<h3>MESSAGE 1</h3>";}
 
elseif((!empty($sid) && !empty($hash))){
 
$db = JFactory::getDBO();
$db->setQuery("SELECT `FieldValue` FROM #__rsform_submission_values WHERE `FieldName`='".$supportTicket."' AND `SubmissionId` = '".$sid."'");
 
if(!empty($db->loadResult())){
 
$db->setQuery("UPDATE `#__rsform_submissions` SET `confirmed` = 1 WHERE `SubmissionId` = '".$sid."'");
$db->execute();
 
$formLayout = "<h3>MESSAGE 1</h3>";
 
RSFormProHelper::sendSubmissionEmails($sid);
}
}  
The administrator has disabled public write access.
The following user(s) said Thank You: Specialist
  • 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!