Using custom email prefixes with mabl Mailbox addresses

You can add a custom prefix to your mabl Mailbox email addresses. While mabl supports creating multiple distinct email addresses in a single test, tagging them with a custom prefix can help you easily mark and differentiate them. This approach can be useful if you need to query the results containing the custom prefixes in your own databases.

Here are the steps you can take to do this:

Create a base email address

  1. Click on the {x} icon to create a variable.
  2. Click on Create a new variable.
  3. Select mabl mailbox address as the variable source.
  4. Give the variable a name.
  5. Click OK.
295295

Create a prefixed email address

  1. Click on the {x} icon to create a variable.
  2. Click on Create a new variable.
  3. Select string template as the variable source.
  4. In the Pattern field, create a value in this form: prefix+{{@base_address}}. The prefixed address should contain a prefix, a separator, and the base address.

📘

Formatting a prefixed mabl Mailbox email address

The prefixed address should contain a prefix, a separator, and the base address.

  • Prefix: the custom prefix may consist of up to 20 lowercase characters as a regex: [a-z0-9]{1,20}
  • Separator: you must place a separator between the prefix and the base address. Supported separators include: dash -, underscore: _, and plus sign: +.
  • Base address: Use mabl variable syntax to refer to the mabl mailbox variable. (In this case, base_address becomes {{@base_address}}.
  1. Give the variable a name.
  2. Click OK.
294294

Whatever prefix you add, all email is sent to the inbox for the original generated base address. You can use the prefixed email address as you would normally for a mabl Mailbox address. For example, send an email to that address and then assert on and interact with the email in the Trainer.