Forum Discussion

cpentecost's avatar
cpentecost
Occasional Contributor
6 years ago

Getting Content from an Email

Hey Community

 

I want to read a generated code in an email sent by one of the API's that we are currently testing in Ready API 3.0.  

Is there a way to take the content of the email so that we can extract the code to pass to another API Call?

 

Any Help is Appreciated.

 

C

  • Hi cpentecost,

     

    There is no special feature for reading content of email messages in ReadyAPI, but, you can try to do this using groovy scripting.

  • avidCoder's avatar
    avidCoder
    Super Contributor

    Can you show an example for that "generated code in an email sent by one of the API's"? How the content looks like? Its in xml/json format.. Just explain.

    • richie's avatar
      richie
      Community Hero
      cpentecost

      Just expanding avidCoder's query.

      Are you saying you send a request to an endpoint and a response comes back and the payload of the response is an email (say .html type so the content can be read by an xmlparser) or are you saying that an email is sent out to a specific mailbox and the content of the email includes a value you need to correlate?

      Reason i ask is that if you just get a response with a payload as an email then thats workable (even if worst case the content type is just text/plain), but if theres some email generator that sends an email to a specific mailbox i think youre going to struggle to incorporate ReadyAPI! into your testing.

      Need to know more details about your use case to gain a clear understanding of what you need to do before we can try and help out fella.
      Dedinitely need to know the datatypeof the response payload for the email which is revealed in the http headers

      Nice one!

      Rich
      • sonya_m's avatar
        sonya_m
        SmartBear Alumni (Retired)

        Thank you guys! 

         

        Hi cpentecost, please provide the Community with more info as required so we can help you!