• 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: Deferring emails

Deferring emails 4 years 2 weeks ago #41143

  • Myannr
  • Myannr's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
Hi,
I want to know if the deferring email setting works with the sandbox pyments because I never received any mails. Neither with paypal, nor with stripe.

Regards

Myann
The administrator has disabled public write access.

Deferring emails 4 years 2 weeks ago #41145

  • andreic
  • andreic's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 745
  • Thank you received: 66
Hello,

Yes, you only need to make sure that the payment confirmations are received correctly. Is the payment status set to Accepted but the deferred email not triggered?
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Deferring emails 4 years 2 weeks ago #41147

  • Myannr
  • Myannr's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
Hi,

yes it is.
I try a sandbox stripe.
The payment status is "Accepted" but no mail.
But if I set the deferring email option to "no", I received the mail, so it's not an email issue.

Regards

Myann
The administrator has disabled public write access.

Deferring emails 4 years 6 days ago #41186

  • Myannr
  • Myannr's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
Hi,

I've just test with the real paypal account and the payment statut wasn't "accepted" but pending and I don't understand why because the payment was ok on paypal.

So can anybody help me please ?

I use custom parameters for
$paypal->args
$paypal->args
$paypal->args


so do I mandatory need $paypal->args and $paypal->args ???
Do I need to set anything on the paypal setting of the configuraton panel please ?


Regards

Myann
The administrator has disabled public write access.

Deferring emails 4 years 4 days ago #41187

  • rgouyon
  • rgouyon's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
I had a similar problem.
My solution was this:
After the submission I put in a special table in my database informations about the form
Then I have build a php script wich is runnning as a cron
In this script I look in my special table in my database if I have informations to treat
If yes I check if the transaction is OK or not and according to that I build an Email and send it to the client
It works with paypal and I guess it should work with stripe
The administrator has disabled public write access.

Deferring emails 4 years 4 days ago #41188

  • Myannr
  • Myannr's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
Hi ans thank you.

It's is so annoying to have to create a script to do what the plugin have to do normally.

Please, Can you show me what tour code looks Line ?
Thank you

Myann
The administrator has disabled public write access.

Deferring emails 4 years 4 days ago #41189

  • rgouyon
  • rgouyon's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Thank you received: 1
here is a part of my cron code
<?php
 
echo "<h2>debut</h2>";
$conbase = new mysqli("xxx.xxx.xxx.xxx", "-------", "xxxxxxxxxx", "xxxxxxxxx");
if ($conbase->connect_errno) {
    echo "Echec lors de la connexion a  MySQL : (" . $conbase->connect_errno . ") " . $conbase->connect_error;
}
else{
	echo "<p>con OK 1234-3</p>";
	$req="SELECT refsub FROM atraiter WHERE traite=0";
	$resultat = $conbase->query($req);
	if(!$resultat){
		echo "<p>Echec lors de la requete : <br>".$req."  (" . $conbase->errno . ") " . $conbase->error;
		}
	else
		{
			echo "<p>req OK</p>";
			$resultat->data_seek(0);
			while ($afaire=$resultat->fetch_assoc()) {
				$idsub=$afaire['refsub'];
				echo "<p>traitement de ".$idsub."</p>";
				//fmail IS YOUR CLIENT EMAIL
				$nomParams=array("fmail","_STATUS","_TRANSACTION_ID");
				$params=array("fmail" => "","_STATUS"=> "","_TRANSACTION_ID"=> "");
				$nbParam=count($params);
				$erreur=0;
				for($item=0;$item<$nbParam;$item++)
					{
						echo "<p>RECHERCHE de ".$nomParams[$item];
						$reqParam="SELECT FieldValue FROM rsform_submission_values WHERE FieldName='".$nomParams[$item]."' AND SubmissionId=".$idsub;
						if (!($resu = $conbase->query($reqParam))) {
							$erreur++;
							echo $nomParams[$item]." ---> est vide</p>";
							}
						else{
							if ($leparam=$resu->fetch_assoc()) {
								$params[$nomParams[$item]]=$leparam['FieldValue'];
								echo " ---> trouve ".$params[$nomParams[$item]]."</p>";								
								}
								else{
									$erreur++;
									echo " ---> est absent</p>";
								}
							}
					}	
				$poursuivre=false;
				if($erreur==0)
				{
					$poursuivre= ($params["_STATUS"]=1) && ($params["_TRANSACTION_ID"]!='');					
				}
				else
				{
					echo "<p> erreur sur les donnees</p>";
				}					
				if($poursuivre)
					{
						echo "<p>traitement de ".$idsub." idtrans=".$params['_TRANSACTION_ID']." mail=".$params['fmail']."</p>";						
						//BUILD YOUR MAIL HERE AND SEND IT
					}
					else{
						echo "<p> TRANSACTION INVALIDE</p>";
					}
 
			}//while
		}
	echo "<p>fermeture</p>";
	$conbase->close();
	}   
	echo "<h2>fin</h2>";
  ?>
my special table name is atraiter and inside there is the submission number of the form.
to have the submission number I have this script in my Script called after form has been processed section
$paypal = RSFormProPayPal::getInstance();
 
// Redirection vers l'accueil si pas d'achat
$paypal->args['cancel_return'] = 'https://www.mywebsite';
 
// Redirection vers le dialogue PPok si achat validé
$paypal->args['return'] = 'https://www.mywebsite/index.php?option=com_rsform&formId=00d&hash='.$_POST['form']['hash'];
 
if the payement is ok I redirect to a form (id=00) in wich I have put this in the Script called on form display section to store the submission id in my special table
// Get the hash from the URL
  if ($hash = JFactory::getApplication()->input->getCmd('hash'))
  {
    $db = JFactory::getDbo();
    $db->setQuery("SELECT SubmissionId FROM #__rsform_submission_values WHERE FieldValue = " . $db->q($hash) . " AND FieldName='hash'");
    $submissionId = $db->loadResult();
 
    if ($submissionId)
    {
 
      // Use the RSForm! Pro helper to retrieve the replacements.
      list($replace, $with) = RSFormProHelper::getReplacements($submissionId);
 
      // Replace the placeholders.
      $formLayout = str_replace($replace, $with, $formLayout);
 
      //insertion du formulaire à traiter
      $query = $db->getQuery(true);
      $columns = array('refsub', 'traite');
      $values = array($submissionId,0);
      // Prepare the insert query.
      $query
        ->insert($db->quoteName('#__atraiter'))
        ->columns($db->quoteName($columns))
        ->values(implode(',', $values));
      // Set the query using our newly populated query object and execute it.
      $db->setQuery($query);
      $db->execute();            
    }
  }

Of course you will have to adapt all this to your problem but the basic is here.
echo instruction are here only for debugging purpose.
The administrator has disabled public write access.
The following user(s) said Thank You: Myannr
  • 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!