DEV Community

Derrick Sherrill for WayScript

Posted on

Confirm Email Validity of Your Mailing List with WayScript


Let’s say that you’ve built your email mailing list, full of potential clients. Before sending messages to them, you might not want to waste money on emails that’ll never reach your potential customer due to the address being invalid.

With Wayscript, you can verify email easily and increase your chances to hit valid email addresses.

Let’s build a script that integrates Google Sheet, SendGrid, and Verify Emails module.


For this post, here is some useful documentation to help you better understand the workflow.

Google Sheet Trigger

Every time a row will be added to a Google spreadsheet, the script will run. To make this, we’ll use Google Sheet Trigger. Add the trigger.

Adding Google Sheet Trigger

The next step is the configuration. You’ll need to connect with your Google Sheet account, choose the mode, and the spreadsheet.

Google Sheet Configuration

You’ll notice new items in the configuration panel. We’ll replace columns names with suitable variables names. The sheet I am using for this example looks like this.

Google Sheet Structure

Only column B will be useful here. Let's name it email in the configuration.

Google Sheet outputs

The trigger is ready now.

Verify Emails

Email verification can be achieved easily using the Verify Email module provided by Wayscript. When given an email address, you’ll get useful information such as for example Email format to check if the email syntax is right and SMTP test to check if the email really exists.

Verify Emails configuration

We have the information we need. Let’s send a mail with SendGrid based on conditions.


The next step is to send an email to the email address. Before doing that, let’s be sure we are not sending emails to an invalid email address.

We will need a If condition and make sure Email_format equal to Valid and SMTP_Test equal to Passed. Add If as a new step and we'll write the conditions.

Adding the conditions

Under the If branch, add the SendGrid module.

Adding Sendgrid module

Add your account and important information.

SendGrid configuration

Under the Else, we’ll add the Write Log module to print the email address if it’s not valid.

Write log module

If you are confused, here is how your workflow will look like.



Questions about this script or anything else? Join our discord. We're always around to help. If you want to work the full script template, just find it here.

Top comments (0)