Class FormControllerApi
Represents a collection of functions to interact with the API endpoints
Inherited Members
Namespace: mailslurp.Api
Assembly: mailslurp.dll
Syntax
public class FormControllerApi : IFormControllerApi, IFormControllerApiSync, IFormControllerApiAsync, IApiAccessor
Constructors
View SourceFormControllerApi()
Initializes a new instance of the FormControllerApi class.
Declaration
public FormControllerApi()
FormControllerApi(Configuration)
Initializes a new instance of the FormControllerApi class using Configuration object
Declaration
public FormControllerApi(Configuration configuration)
Parameters
Type | Name | Description |
---|---|---|
Configuration | configuration | An instance of Configuration |
FormControllerApi(ISynchronousClient, IAsynchronousClient, IReadableConfiguration)
Initializes a new instance of the FormControllerApi class using a Configuration object and client instance.
Declaration
public FormControllerApi(ISynchronousClient client, IAsynchronousClient asyncClient, IReadableConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
ISynchronousClient | client | The client interface for synchronous API access. |
IAsynchronousClient | asyncClient | The client interface for asynchronous API access. |
IReadableConfiguration | configuration | The configuration object. |
FormControllerApi(string)
Initializes a new instance of the FormControllerApi class.
Declaration
public FormControllerApi(string basePath)
Parameters
Type | Name | Description |
---|---|---|
string | basePath |
Properties
View SourceAsynchronousClient
The client for accessing this underlying API asynchronously.
Declaration
public IAsynchronousClient AsynchronousClient { get; set; }
Property Value
Type | Description |
---|---|
IAsynchronousClient |
Client
The client for accessing this underlying API synchronously.
Declaration
public ISynchronousClient Client { get; set; }
Property Value
Type | Description |
---|---|
ISynchronousClient |
Configuration
Gets or sets the configuration object
Declaration
public IReadableConfiguration Configuration { get; set; }
Property Value
Type | Description |
---|---|
IReadableConfiguration | An instance of the Configuration |
ExceptionFactory
Provides a factory method hook for the creation of exceptions.
Declaration
public ExceptionFactory ExceptionFactory { get; set; }
Property Value
Type | Description |
---|---|
ExceptionFactory |
Methods
View SourceGetBasePath()
Gets the base path of the API client.
Declaration
public string GetBasePath()
Returns
Type | Description |
---|---|
string | The base path |
SubmitForm(string, string, string, string, string, string, string, int)
Submit a form to be parsed and sent as an email to an address determined by the form fields 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://csharp.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://csharp.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\">
.
Declaration
public string SubmitForm(string to = null, string subject = null, string redirectTo = null, string emailAddress = null, string successMessage = null, string spamCheck = null, string otherParameters = null, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
string | to | The email address that submitted form should be sent to. (optional) |
string | subject | Optional subject of the email that will be sent. (optional) |
string | redirectTo | Optional URL to redirect form submitter to after submission. If not present user will see a success message. (optional) |
string | emailAddress | Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later. (optional) |
string | successMessage | Optional success message to display if no _redirectTo present. (optional) |
string | spamCheck | Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored. (optional) |
string | otherParameters | All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent. (optional) |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
string | string |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
SubmitFormAsync(string, string, string, string, string, string, string, int, CancellationToken)
Submit a form to be parsed and sent as an email to an address determined by the form fields 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://csharp.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://csharp.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\">
.
Declaration
public Task<string> SubmitFormAsync(string to = null, string subject = null, string redirectTo = null, string emailAddress = null, string successMessage = null, string spamCheck = null, string otherParameters = null, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | to | The email address that submitted form should be sent to. (optional) |
string | subject | Optional subject of the email that will be sent. (optional) |
string | redirectTo | Optional URL to redirect form submitter to after submission. If not present user will see a success message. (optional) |
string | emailAddress | Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later. (optional) |
string | successMessage | Optional success message to display if no _redirectTo present. (optional) |
string | spamCheck | Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored. (optional) |
string | otherParameters | All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent. (optional) |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<string> | Task of string |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
SubmitFormWithHttpInfo(string, string, string, string, string, string, string, int)
Submit a form to be parsed and sent as an email to an address determined by the form fields 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://csharp.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://csharp.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\">
.
Declaration
public ApiResponse<string> SubmitFormWithHttpInfo(string to = null, string subject = null, string redirectTo = null, string emailAddress = null, string successMessage = null, string spamCheck = null, string otherParameters = null, int operationIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
string | to | The email address that submitted form should be sent to. (optional) |
string | subject | Optional subject of the email that will be sent. (optional) |
string | redirectTo | Optional URL to redirect form submitter to after submission. If not present user will see a success message. (optional) |
string | emailAddress | Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later. (optional) |
string | successMessage | Optional success message to display if no _redirectTo present. (optional) |
string | spamCheck | Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored. (optional) |
string | otherParameters | All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent. (optional) |
int | operationIndex | Index associated with the operation. |
Returns
Type | Description |
---|---|
ApiResponse<string> | ApiResponse of string |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |
SubmitFormWithHttpInfoAsync(string, string, string, string, string, string, string, int, CancellationToken)
Submit a form to be parsed and sent as an email to an address determined by the form fields 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://csharp.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://csharp.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\">
.
Declaration
public Task<ApiResponse<string>> SubmitFormWithHttpInfoAsync(string to = null, string subject = null, string redirectTo = null, string emailAddress = null, string successMessage = null, string spamCheck = null, string otherParameters = null, int operationIndex = 0, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | to | The email address that submitted form should be sent to. (optional) |
string | subject | Optional subject of the email that will be sent. (optional) |
string | redirectTo | Optional URL to redirect form submitter to after submission. If not present user will see a success message. (optional) |
string | emailAddress | Email address of the submitting user. Include this if you wish to record the submitters email address and reply to it later. (optional) |
string | successMessage | Optional success message to display if no _redirectTo present. (optional) |
string | spamCheck | Optional but recommended field that catches spammers out. Include as a hidden form field but LEAVE EMPTY. Spam-bots will usually fill every field. If the _spamCheck field is filled the form submission will be ignored. (optional) |
string | otherParameters | All other parameters or fields will be accepted and attached to the sent email. This includes files and any HTML form field with a name. These fields will become the body of the email that is sent. (optional) |
int | operationIndex | Index associated with the operation. |
CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Task<ApiResponse<string>> | Task of ApiResponse (string) |
Exceptions
Type | Condition |
---|---|
ApiException | Thrown when fails to make API call |