Let us discuss how you can integrate Razorpay with Contact Form 7 and Gmail. Following this integration, you will be able to automatically send your Contact Form 7 respondents a Razorpay payment link via Gmail.
This automation requires a one-time setup, for which we will use Pabbly Connect.
We will first link Contact Form 7 with Pabbly Connect to capture responses, then link Pabbly Connect with Razorpay to generate the payment link, and at last, send this payment link to Contact Form 7 respondents via Gmail.
How to Automatically Send Razorpay Payment Link on Successful Contact Form 7 Submission Via Gmail
1. Sign In / Sign Up to Pabbly Connect and Create a Workflow
2. Establish a link between Contact Form 7 and Pabbly Connect
3. Add a Filter to the Workflow
4. Setup Razorpay as the Action App to Generate Payment Link
5. Setup Gmail as the Action App to Send Email
Step 1:- Sign In / Sign Up to Pabbly Connect and Create a Workflow
A. Sign In / Sign Up
To begin this process, visit Pabbly Connect and create your account by clicking on the ‘Sign Up Free’ button. You can also click on Sign In if you already have an account.
Click on the Pabbly Connect ‘Access Now’ button
B. Create Workflow
To create a new workflow, click the ‘Create Workflow’ button.
Name your workflow, and click on ‘Create’.
Step 2:- Establish a link between Contact Form 7 and Pabbly Connect
We will look at the steps through which we can establish a link between Contact Form 7 and Pabbly Connect. This will help us capture the Contact Form 7 responses.
A. Trigger App
Trigger allows us to choose the application that will receive the data for Pabbly Connect. To capture the Contact Form 7 responses will use Webhook as our trigger app.
Expand the trigger step, and choose ‘Webhook by Pabbly’ as your trigger app.
B. Webhook URL
A new Webhook URL will get generated. You will use this Webhook URL to create a connection with your WordPress account. Copy the Webhook URL.
As soon as you Copy the Webhook URL, Pabbly Connect will start looking to capture data from Contact Form 7, as indicated by the rotating Waiting For Webhook Response button.
C. Connect WordPress Account
To connect with your WordPress account, go to your WordPress dashboard and click on ‘Settings’ > ‘WP Webhooks’
Click on ‘Send Data’, scroll down to find Contact Form 7 plugin, and select ‘Form submitted’.
Click the ‘Add Webhook URL’ button. A dialogue box will appear asking you for Webhook Name and Webhook URL.
Give a Name, paste the Webhook URL we copied earlier, and click on ‘Add for cf7_forms’.
C. Test Connection
Now that we have established a connection, we will submit a dummy form to test this connection.
Fill up and submit the form with dummy details.
We have received a response containing the user details, thus confirming our established connection.
Step 3:- Add a Filter to the Workflow
We want the Razorpay payment link to be generated only in cases where the respondents chose to continue by selecting Yes. To do so, we will add a filter to our workflow.
Note: You can skip this step if you want to generate the payment link for all responses.
Choose ‘Filter by Pabbly’ as the Action App, map the Label from the step above, select ‘Equal to’ as the Filter Type, and enter the Value. At last, click on ‘Save & Send Test Request’.
Doing this will ensure that the next step in your workflow will get executed only if the user responds with a yes.
Step 4:- Setup Razorpay as the Action App to Generate Payment Link
Action allows us to choose the application that will get executed by the workflow trigger.
We essentially want to generate a Razorpay payment link to be shared with respondents. Thus, Razorpay will be our Action App.
Add another Action Step to your workflow by clicking the ‘+’ button.
A. Action App
Choose ‘Razorpay’ as the Action App, select ‘Create Payment Link’ as an Action Event, and click on ‘Continue’.
B. Connect Razorpay Account
To connect with your Razorpay account, select ‘Add New Connection’. You will be asked to enter your Key ID and Key Secret.
To get the credentials, go to your Razorpay dashboard, and click on ‘Settings’ > ‘API Keys’ > ‘Regenerate Test Key’.
Copy both Key ID and Key Secret, paste both in their respective fields, and click on ‘Save’.
C. Map Necessary Fields
Now that you have connected your Razorpay account, all you need is to map the necessary details from the step above. Mapping ensures our data remains dynamic and changes as per the received responses.
Enter the Amount in and Currency in its lowest denomination.
Write a Description stating the purpose of the payment link.
Enter the time at which you want the link to Expire in the UNIX timestamp.
Map the Name from the trigger step.
Similarly, map the other fields, leaving the unnecessary ones empty, and click on ‘Save & Send Test Request’.
A payment link will be generated, which you can then use to collect the payments.
Step 5:- Setup Gmail as the Action App to Send Email
Now that we have generated the payment link, all we need is to send this link to the users via Gmail. For doing so, we will now set up Gmail as our Action App.
Add another Action Step to your workflow by clicking the ‘+’ button.
A. Action App
Choose ‘Gmail’ as your Action App, select ‘Send Email’ as an Action Event, and click on ‘Connect’.
B. Connect Gmail Account
To connect your Gmail account, select ‘Add New Connection’, and click on ‘Connect With Gmail’. Also, grant the authorization. This account will be used for sending emails.
C. Map the Necessary Fields
Map the Recipient’s Email Address from above.
Enter the Subject of your email. If you wish, you can also add a Sender Name.
Compose an Email along with the payment link by mapping it from the step above, and click on ‘Save & Send Test Request’.
As soon as you click on Save & Send Test Request, a payment link will be sent to respondents at their Gmail address.
Our automation is complete. We have successfully integrated Contact Form 7 with Razorpay and Gmail. Now each new user who responds to your Contact Form 7 will automatically receive an email containing the Razorpay payment link, which they can then use to make the payment.
You can copy this entire workflow by clicking this link.
Sign Up for a free Pabbly Connect account, and start automating your business
Subscribe to our Youtube Channel for more such automation
For any other queries, visit our forum