Class: FormControllerApi

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new FormControllerApi(configuration?)

Parameters

NameType
configurationConfiguration

Inherited from

BaseAPI.constructor

Properties

configuration

Protected configuration: Configuration

Inherited from

BaseAPI.configuration

Methods

request

Protected request(context, initOverrides?): Promise<Response>

Parameters

NameType
contextRequestOpts
initOverrides?RequestInit

Returns

Promise<Response>

Inherited from

BaseAPI.request


submitForm

submitForm(requestParameters, initOverrides?): Promise<string>

This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a _to email address to tell the endpoint where the form should be emailed. These can be submitted as hidden HTML input fields with the corresponding name attributes or as URL query parameters such as ?_to=test@example.com The endpoint takes all other form fields that are named and includes them in the message body of the email. Files are sent as attachments. #### Submitting This endpoint accepts form submission via POST method. It accepts application/x-www-form-urlencoded, and multipart/form-data content-types. #### HTML Example html <form action="https://api.mailslurp.com/forms" method="post" > <input name="_to" type="hidden" value="test@example.com"/> <textarea name="feedback"></textarea> <button type="submit">Submit</button> </form> #### URL Example html <form action="https://api.mailslurp.com/forms?_to=test@example.com" method="post" > <textarea name="feedback"></textarea> <button type="submit">Submit</button> </form> The email address is specified by a _to field OR is extracted from an email alias specified by a _toAlias field (see the alias controller for more information). Endpoint accepts . You can specify a content type in HTML forms using the enctype attribute, for instance: <form enctype="multipart/form-data">. Submit a form to be parsed and sent as an email to an address determined by the form fields

Parameters

NameType
requestParametersSubmitFormRequest
initOverrides?RequestInit

Returns

Promise<string>


submitFormRaw

submitFormRaw(requestParameters, initOverrides?): Promise<ApiResponse<string»

This endpoint allows you to submit HTML forms and receive the field values and files via email. #### Parameters The endpoint looks for special meta parameters in the form fields OR in the URL request parameters. The meta parameters can be used to specify the behaviour of the email. You must provide at-least a _to email address to tell the endpoint where the form should be emailed. These can be submitted as hidden HTML input fields with the corresponding name attributes or as URL query parameters such as ?_to=test@example.com The endpoint takes all other form fields that are named and includes them in the message body of the email. Files are sent as attachments. #### Submitting This endpoint accepts form submission via POST method. It accepts application/x-www-form-urlencoded, and multipart/form-data content-types. #### HTML Example html <form action="https://api.mailslurp.com/forms" method="post" > <input name="_to" type="hidden" value="test@example.com"/> <textarea name="feedback"></textarea> <button type="submit">Submit</button> </form> #### URL Example html <form action="https://api.mailslurp.com/forms?_to=test@example.com" method="post" > <textarea name="feedback"></textarea> <button type="submit">Submit</button> </form> The email address is specified by a _to field OR is extracted from an email alias specified by a _toAlias field (see the alias controller for more information). Endpoint accepts . You can specify a content type in HTML forms using the enctype attribute, for instance: <form enctype="multipart/form-data">. Submit a form to be parsed and sent as an email to an address determined by the form fields

Parameters

NameType
requestParametersSubmitFormRequest
initOverrides?RequestInit

Returns

Promise<ApiResponse<string»


withMiddleware

withMiddleware<T>(…middlewares): T

Type parameters

NameType
Textends BaseAPI<T>

Parameters

NameType
...middlewaresMiddleware[]

Returns

T

Inherited from

BaseAPI.withMiddleware


withPostMiddleware

withPostMiddleware<T>(…postMiddlewares): T

Type parameters

NameType
Textends BaseAPI<T>

Parameters

NameType
...postMiddlewares(context: ResponseContext) => Promise<void

Returns

T

Inherited from

BaseAPI.withPostMiddleware


withPreMiddleware

withPreMiddleware<T>(…preMiddlewares): T

Type parameters

NameType
Textends BaseAPI<T>

Parameters

NameType
...preMiddlewares(context: RequestContext) => Promise<void

Returns

T

Inherited from

BaseAPI.withPreMiddleware