In this article, we'll walk you through the process of creating a Gmail filter to automatically forward emails from a specific sender with a certain subject line to another email address.

This can be particularly useful if you need to forward notifications or alerts.

Why Set Up Email Forwarding with Filters?

Email forwarding filters are a powerful tool in Gmail, enabling you to automate the process of rerouting specific emails based on defined criteria. For example, you might receive an important email from a specific sender and need to forward it to another service. With Gmail's filtering system, you can easily set up this rule, and Gmail will automatically forward the emails for you.

Step 1: Confirm your Forwarding Email Address

You need to decide on the appropriate email address to forward to, depending on the type of message you want to send.

  • Sending as an SMS to a single mobile number: Your forwarding address will be [mobile]@sms.tnz.co.nz, e.g. 021000001@sms.tnz.co.nz 
  • Sending as a Voice Call to a telephone number: Your forwarding address will be [phone]@voice.tnz.co.nz, e.g. 021000001@voice.tnz.co.nz
  • Sending as an SMS to a group of mobile numbers: Your forwarding address will be [group_code]@sms.tnz.co.nz, e.g. my_alert_group@sms.tnz.co.nz 
  • Sending as a Voice Call to a group of telephone numbers: Your forwarding address will be [group_code]@voice.tnz.co.nz, e.g. my_alert_group@voice.tnz.co.nz

Your group code can be found in the TNZ Address Book under Group Maintenance.

Step 2: Add the Forwarding Email Address

Before you can create a filter that forwards emails, Gmail requires you to verify the forwarding address. Here's how to do it:

  1. Log into your Gmail account and click on the Settings gear icon in the top-right corner of your inbox.
  2. Click on See all settings.
  3. Navigate to the Forwarding and POP/IMAP tab.
  4. Under the Forwarding section, click on Add a forwarding address.
  5. A pop-up window will appear. Enter the email address you wish to forward to (e.g., [mobile]@sms.tnz.co.nz), then click Next.
  6. Gmail will send a confirmation email to TNZ, and the TNZ email system will forward this back to your email inbox. Find the email in your inbox and open the verification link to verify the address.
  7. Once verified, the forwarding email address will be available for use in Gmail filters.

Step 3: Create a Gmail Filter to Forward Specific Emails

Now that the forwarding address has been added, you can create a filter to automatically forward emails from the sender and subject of your choice.

  1. In Gmail, go to Settings again by clicking on the Settings gear icon and selecting See all settings.
  2. Navigate to the Filters and Blocked Addresses tab.
  3. Click on Create a new filter.
  4. In the filter creation form, fill out the fields as follows:
    • From: Enter the sender's email address (e.g., 'alerts@software.com').
    • Subject: Enter the exact subject line you want to filter for (e.g., 'Warning: An alert has been raised').
  5. Once you've entered the details, click Create filter.
  6. In the filter options, check the box labeled Forward it to and select the appropriate email address from the dropdown menu.
    If you prefer the email to be forwarded but don't want to see it in your Gmail inbox, you can also check the option Skip the Inbox (Archive it).
  7. Finally, click Create filter to activate the rule.

Step 4: Test the Filter

To ensure your filter works correctly:

  1. Send a test email from the specified email address with the subject line you defined in the filter.
  2. Check the message arrives as an SMS or Voice Call as expected.

Managing and Editing Your Filter

If you ever need to change or delete this forwarding filter:

  1. Go to Settings > Filters and Blocked Addresses.
  2. Locate the filter and click Edit to modify the criteria or Delete to remove the filter altogether.

Conclusion

By following the steps outlined in this guide, you can set up Gmail to automatically forward emails based on specific criteria. This can help streamline workflows, sending important notifications as SMS or Voice.