Quantcast
Channel: WP Garage
Viewing all articles
Browse latest Browse all 78

Gravity Forms Tip: How to Add a PayPal Transaction ID to notifications on a WordPress site

$
0
0

Gravity Forms is by far my favorite forms plugin for WordPress – with all the great extensions, like PayPal and Mailchimp, and the ease of use for clients.

So, if you’re using Gravity Forms (aff) in conjunction with the PayPal Addon to get donations or to sell individual products, you may need to send the PayPal Transaction ID to your customer or keep it for your own records.

Here’s how:

In your functions.php add the following:

add_filter( 'gform_replace_merge_tags', 'replace_transaction_id', 10, 7 );
function replace_transaction_id( $text, $form, $entry, $url_encode, $esc_html, $nl2br, $format ) {
$transaction_id = empty( $transaction_id ) ? rgar( $entry, 'transaction_id' ) : $transaction_id;
$text = str_replace( '{transaction_id}', $transaction_id, $text );
return $text;
}

In the Notifications (Under Form Settings > Notifications), use the merge tag {transaction_id}.transactionid

That’s it!

This post was originally published at Gravity Forms Tip: How to Add a PayPal Transaction ID to notifications on a WordPress site on WP Garage - WP Garage - WordPress tricks, hacks, and tips.


Viewing all articles
Browse latest Browse all 78

Trending Articles