# Example with Restmail.net

[Restmail.net](http://restmail.net/) is probably the simplest toll to start with. It's free, it's requires no registration, it allows to create dynamically inboxes, it exposes a REST API to read received emails. However all the sent messages are public.&#x20;

Let's take the previous test suite and modify it a bit. For Restmail.net we need user alias instead of email to check the inbox. So we can generate it like that.

![User alias for Restmail.net](/files/-LiDgHAJHk-1Av_S9oCV)

As you see we also changed `TEST_EMAIL` template variable generation. Now it build based on earlier created `TEST_USER_ALIAS` one.

Next we find `page.assignVarRemotely` command and update the URL for of of Restmail.net:

```
http://restmail.net/mail/{{ TEST_USER_ALIAS }}
```

What we need now is a custom parser function in `page.assignVarRemotely` :

```javascript
( json, payload ) => {
  const parseActivationLink = ( text ) => {
          const re = /(http\:[^\"]+4567\/con[^\"]+)/g,
                res = text.match( re );
          return res ? res[ 0 ].replace( "=\r\n", "" ) : null;
        },
        sentAt =  payload.sentAt,
        unseen = json.find( msg => new Date( msg.receivedAt ) > new Date( sentAt ) );

  if ( !unseen ) {
    return null;
  }

  return parseActivationLink( unseen.html );
}
```

The function has second parameter `payload` with `sentAt` property that contains sending event timestamp. Here we check if there are any messages received  later then the application under test sent the activation email. If any found we parse it for the activation link.

Our `page.assignVarRemotely` command configuration shall look now like that:

![page.assignVarRemotely configuration ](/files/-LiIP-V5ybN7WKbDU9N_)

Now we can save the changes and run the tests. On the generated screenshots we can see that a new account was created and activated.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.puppetry.app/testing-techniques/testing-emails/example-with-restmail.net.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
