Contact Forms for WordPress on Google Cloud

Author avatar wrote on 20/07/2019

Contact Forms for WordPress on Google Cloud

To set up contact forms for WordPress on Google Cloud, There are 4 important steps to follow. Please note that we assume that you already have a WordPress website installed on Google Cloud, if not, please read this toturial to install WordPress website on Google Cloud

  • Install form generator Plugin
  • Install Mail Plugin
  • Create a Gmail web App
  • Test your work

1. Install Contact Form 7 Plugin and Edit Settings

You will need to install and activate is Contact Form 7. This plugin will be used to create contact forms for WordPress

  1. Install the plugin
  2. Activate it
  3. In the left menu go to contacts
  4. Create a form
  5. Navigate to the Mail tab, and change the “To” field to the Gmail/G suite address where you want the contact form submissions to be sent.
  6. Save form
  7. Copy the form shortcode
  8. Past the form shortcode on the page you want the form to appear on

2. Install WP Mail SMTP Plugin and Edit Settings

Install and activate the WP-Mail-SMTP plugin. This plugin will be used to re-configure your mail settings.

  1. Install the WP Mail SMTP Plugin
  2. Activate the plugin
  3. Navigate to settings and choose Gmail
  4. Add your Gmail / G Suite account and save

3. Create a Gmail Web Application

sign into your Gmail account and access Gmail’s application registration

Create a project Next, you should see a screen that says “The API is enabled

Click the Go to credentials button.

  1. Which API are you using? Gmail API
  2. Where will you be calling the API from? Web server (e.g. node.js, Tomcat)
  3. What data will you be accessing? User data
  4. Click the What credentials do I need?
  5. Click on Set Up Consent Screen Option.
  6. Application name is website name
  7. Authorized domain your domain
  8. Save information
  9. Click on create Credentials
  10. Choose Oauth client ID
  11. Choose web application
  12. Authorized JavaScript origins add your domain
  13. Get the Authorized redirect URIs  from the WP Mail SMTP Plugin page and paste it
  14. Click create
  15. Copy the Oauth client info and paste on the WP Mail SMTP Plugin setting
  16. On the WP Mail SMTP Plugin setting Click on Allow plugin to send emails using your Google account

4. Send Test Emails

  1. On WP mail SMTP plugin page navigate to email test
  2. Add any email of yours and click test
  3. Test also the contact forms for WordPress you added to your website
  4. If it did not work you might need to Allow Less Secure Apps https://myaccount.google.com/lesssecureapps