Parsed Links on Messages API

Message metadata will now include pre-parsed links. This enhancement should make automation even easier.

 

For example, say you want to test email signup confirmations on your website. Normally you would need to request the inbox for the test inbox:

GET /api/addresses/mytestemail@example.com/messages
[{
  _id: 'y39sak29gaer-0',
  subject: 'Confirm your email address',
  from: [{ address: 'noreply@sampleservice.com' }],
  to: [{ address: 'mytestemail@example.com' }]
  // more fields
}]

then download the full email or body:

GET /api/dirty/mytestemail@example.com/y39sak29gaer-0
<div>
  <a href="https://www.sampleservice.com/email-confirmation/39349234">Confirm your email!</a>
</div>

then parse the contents and search for the link.

Now the message metadata from the first request will also include a links array of strings:

GET /api/addresses/mytestemail@example.com/messages
[{
  _id: 'y39sak29gaer-0',
  subject: 'Confirm your email address',
  from: [{ address: 'noreply@sampleservice.com' }],
  to: [{ address: 'mytestemail@example.com' }]
  links: ['https://www.sampleservice.com/email-confirmation/39349234']
}]

This feature should save you a roundtrip to the API and let you not worry about properly parsing HTML links.

 

API Reference

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.