MailSlurp logo

solutions

Send and receive email + SMS in Salesforce MuleSoft

Read email and TXT messages in munit test suites to validate user functionality end-to-end.

Munit email and SMS testing

Connect your test-suite.xml to MailSlurp APIs to send, receive, and wait for matching emails and SMS within Mulesoft tests. Empower QA and developers within your Salesforce enterprise.

<mule xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core">
    <munit:test name="MailSlurpEnd-to-End"
                description="Create inbox → confirm → wait for email">
        <munit:execution>
            <http:request-config name="MailSlurp_HTTP"
                                 doc:name="MailSlurp HTTP"
                                 basePath="https://api.mailslurp.com">
                <http:request-connection host="api.mailslurp.com"
                                         port="443"
                                         protocol="HTTPS"/>
            </http:request-config>

            <http:request method="GET"
                          path="/waitForLatestEmail?inboxId=#[vars.inboxId]&amp;timeout=60000&amp;apiKey=#[vars.apiKey]"
                          config-ref="MailSlurp_HTTP"
                          doc:name="Wait for latest email"/>
        </munit:execution>
        <munit:validation>
            <munit-tools:assert-that expression="#[payload.subject]"
                                     is="#[MunitTools::equalTo('test')]"
                                     doc:name="Assert subject"/>
            <munit-tools:assert-that expression="#[attributes.statusCode]"
                                     is="#[MunitTools::equalTo(2300)]"
                                     doc:name="Assert status 200"/>
        </munit:validation>
    </munit:test>
</mule>

Applications

Many Mulesoft apps need email accounts and phone number messaging capabilities. MailSlurp enables API Led Connectivity by integrating deeply munit assertions and the mulesoft runtime. Simple make standard <http:request/> calls within your app and request email and SMS from the MailSlurp REST API.

Get started

Hop right into email and SMS testing with our Salesforce integrations available on the developer portal.