Use cases for functional testing with emails

Functional testing, used to check the end results of a piece of software or code, is a critical part of developing any automated email campaign because it ensures your customers are getting reliable, error-free, professional emails that effectively build your brand's reputation.

When to perform functional testing on emails?

If your emails have mistakes, they're more likely to be marked as spam. This will decrease the deliverability of your messages in the future, usually requiring an in-depth intervention to signal to spam filters that you're a good sender, costing you time, money, and customers. That's why it's crucial to keep your email deliverability consistently high.

One of the best ways to ensure your emails aren’t going to be marked as spam is to perform functional testing, especially if you’ve automated the process for sending them. Functional testing takes a set of inputs and returns the outputs the code dictates. Checking these outputs to make sure they match what you expect them to be will tell you if there are bugs in your code that can affect your customers’ experiences.

You should perform functional testing any time you’re sending emails or setting up flows and other automated processes to make sure everything is working properly. It’s much cheaper to catch mistakes before your deployments go live.

Functional testing use cases for emails

In order to set up functional testing for your emails, you’ll need to know what steps the user takes to provide inputs to your code. Use cases outline each individual step for a specific goal. The level of detail can depend on what’s needed for your project, either a general overview or broken down into the most detailed description possible. Different scenarios you might need to develop use cases for include:

  • Accessibility
  • Segmentation
  • Opting out of emails
  • Signing up for a newsletter
  • Leaving a product review


Making your emails accessible to your customers is important. An example of this would be using alternate text with any images in your emails. Some email providers may not automatically load images, and some people use text-to-speech software that can’t read images, so adding in the alternate text makes your email readable in these scenarios. Accessibility can also include viewing emails on mobile vs. desktop computers, with different email providers, and in different browsers. Here’s an example use case:

The user checks their email on their phone and sees they have a new message. They click on the message to open it. Their email provider settings do not automatically display images, so they see the alternate text along with the other text in the email. They click a button to load images in the email.


Segmentation in email campaigns refers to splitting your subscriber base into smaller segments defined by common characteristics so they can have a more personalized experience. You might want to segment your subscribers based on who’s purchased something recently, or what their interests are, or a variety of other categories. Segmentation is helpful when you need to send a large batch of emails to a portion of your subscribers, but the emails aren’t relevant to the people outside that group.

A possible use case for segmentation might look like this:

A user makes a purchase for cat food. They get added to the segment for cat owners. A week after their purchase, they get an email recommending other popular cat supplies for sale. They click on the email from you to open it. They click on a link in the email to see a particular product on your website.

Opting out of emails

Having a quick and easy way for people to unsubscribe from your emails is important to keep your email deliverability high. People who don’t want your emails may mark them as spam, which makes it more likely that spam filters will think all your emails are spam.

A sample use case for someone who wants to unsubscribe from you is below:

A user gets an email from you. They click on the email and scroll to the bottom looking for an unsubscribe link. They click the link, and are taken to a page confirming whether they want to unsubscribe. They click the button that says “confirm”. They are redirected to a page that tells them they successfully unsubscribed. They are taken off all of your email lists and segments.

Signing up for a newsletter

If someone wants to hear more about your products, they might want to subscribe to your emails.

Here’s a sample use case:

The user goes to your website and puts their email in a popup asking them to subscribe. Their email is added to a segment for new subscribers. They receive a confirmation email notifying them they successfully subscribed. Three days later, they get an email with more information on your products.

Leaving a product review

Collecting reviews from recent customers can be done with email campaigns as well. Many customers will look for honest reviews from their peers before making a purchase, so asking people to leave reviews can help you convince a potential buyer to commit.

A use case for this is below:

A customer makes a purchase on your website. They get added to a segment for recent purchases. Two weeks later, they get an email from you asking for feedback on your product. They click on the email to open it. They click on the link in the email to leave a review. They are redirected to the reviews section of your website.

Different types of functionality testing

Once you have use cases for the scenarios your customers are likely to encounter, it’s time to plan your testing. There are many different kinds of functionality testing since it’s performed throughout the development period to give specific information on how the software is performing.

Some of the most common types are defined below:

Unit Testing

A type of testing that checks small pieces of code, or units, to make sure each piece does what it’s supposed to. The pieces are tested as individual components, not as a combined whole.

Integration Testing

Integration testing builds on unit testing. It combines pieces of code together and checks that they operate smoothly together.

Smoke Testing

Smoke testing involves running quick, inexpensive tests to make sure the software doesn’t have any major issues during development. If a smoke test reveals a problem, it’s easier to fix because it was detected earlier.

System Testing

System testing is one of the final types of testing performed. Once the entire system is put together from all the pieces of code, system testing is performed to see if the project meets its requirements.

Sanity Testing

This kind of testing is done when the software is already completed and stable, and checks to make sure small changes haven’t impacted the functionality.

Acceptance Testing

Acceptance testing is done once system testing is completed. Its purpose is to check whether the system is ready to be delivered as a final product.

Alpha Testing

This is a type of acceptance testing completed by people who work for the same company that developed the software, but aren’t the developers themselves.

User Acceptance Testing

User acceptance testing, also known as beta testing, is another type of acceptance testing. It’s performed by the software’s users.

How to write functional test cases

Now that you know about use cases and the different types of functional testing, you’re prepared to write your own functional test cases. These outline the information the person conducting the tests needs in order to complete them.

The steps you’ll need to follow are:

  1. Figure out the test goal
  2. Determine the preconditions
  3. Write each step
  4. Write down the expected output

Figure out the test goal

Write down what the purpose of the test is. You might be checking if a particular use case is functional, or if part of an email campaign is deployed at the right time. This will vary depending on the type of functional testing you’re doing.

Determine the preconditions

You’ll want to record what the tester needs to set up in order to conduct the test. Do they need to be logged in to your website, or have access to a test email account? This step makes sure they’re prepared.

Write each step

Walk through your use case and write a step to check each part of the scenario. Add as much detail as necessary here, as the more thorough your procedure, the more certain you can be that you’ve covered all your bases when the test is complete.

Write down the expected output

Record what the end result of the test is supposed to be. The tester will compare the result they get to what’s expected, and any differences will need to be fixed.

How to test your emails with Mailosaur

Conducting functionality testing on your emails will help you make sure your communications with your customers are professional and engaging. Mailosaur provides guides on how to perform functional email testing under many different conditions, including on how to conduct functional tests for different email clients. We also provide software that can be integrated with your current testing framework that helps you set up testing inputs like email addresses and servers. Try it free to see how our tools can improve your email campaigns.