0

This the email. It is in HTML and I am trying to retrieve the code Email

I am getting this Error

I just put an assertion just to check if I am getting the body of the email but the error says it's ''

AndyD
  • 5,252
  • 35
  • 32
simpleMan
  • 1
  • 1

1 Answers1

1

Emails typically have two parts, an html part and a text part. This is so that when you are reading an email on a device that doesn't support html (rare these days) the text version can be shown.

To answer your question: you need to change your code to use email.html.body rather than email.text.body as you don't have a text version of your email.

You should be able to retrieve your authentication code via email.html.codes[0] as well.

AndyD
  • 5,252
  • 35
  • 32