I have a form with contact form 7 in a WordPress site. When you click on "submit" you are redirected on Paypal and pleased to pay :). Everything works well, but the I want something more. I want to send the mail, ONLY when visitors have pay on Paypal. I've searched on google, but I don't have found the way to do this.
Any ideas ?
Thanks !
Nathan
You can use PayPal IPN to get this done. There is a free plugin available to get PayPal IPN setup in WordPress very easily, but then you'll need to make a basic hook from your functions.php file (or your own plugin) to trigger the email based on when you want it sent.
You can trigger any action you want based on different PayPal transaction types or payment status.
Here is a very basic example of sending an email from an extension to the IPN plugin. This is a full plugin file with nothing but a hook to the plugin. In this case I'm using the paypal_ipn_for_wordpress_txn_type_cart hook.
So with both the IPN plugin and this plugin installed on your site, any time a cart transaction is made on your PayPal account an email would be sent accordingly. This is a sample of the email I received when running a test transaction on PayPal with this plugin activated on the site.
Of course, you could spend the time to make the email more pretty and send it to any email address(es) you need to.
So again, you can use lots of different hooks to trigger your own plugin functions like this based on different IPN types or payment status.
The sample here only includes a few data parameters that IPN provides, but the IPN record in WordPress will give you a template you can easily copy/paste into your own plugin file that includes every IPN parameter available to that type of IPN.