Menu

Snippets

Yet another programmer blogging about code

Payment receipts with Gravity Forms and eWAY

Gravity Forms email notifications can be used to send simple payment receipts for eWAY transactions.

When you build a form with Gravity Forms, you typically want to get an email sent to you for each submission. By default, Gravity Forms creates a simple notification with all the form fields in it. It’s nicely formatted into a table, so that you can easily see all the fields and what was entered.

Sometimes you also want to send an email to the person who filled in the form. Rather than a table with everything, it’s nicer to format the email in more natural language and with only selected details from the form. The first step is to create a new notification.

Find the form in the WordPress admin and click its edit link. Under Settings, click Notifications. You can now add a new notification (email) — click the Add New button next to the Notifications heading:

Add a notification email to a form
Add a notification email to a form

Enter the basic details for the notification, including where to send it (generally the email field in the form) and who to send it from (generally your company / website name and the admin email address, or a custom address).

Note that we’ve selected the Payment Completed event. That means that this email will only be sent on a successfully completed transaction. If you always want the notification sent, set the event to Form is submitted.

Set the basic notification details
Set the basic notification details

Now you need to write your notification email. You can include some fields from the form using merge tags, like the first and last name, as well as the date of entry. There’s a little drop-down list of merge tags on the end of the message field.

Editing the message for a notification email
Editing the message for a notification email

Because this form uses the Gravity Forms eWAY payment integration, it has a few extra merge tags for adding payment details like the payment amount and the transaction ID. Not all payment integrations support these merge tags, however.

Once you save the notification, it will be sent whenever someone makes a successful payment.