Class CreateWebhookOptions
Options for creating a webhook. Webhooks can be attached to inboxes and MailSlurp will POST a webhook payload to the URL specified whenever the webhook's event is triggered. Webhooks are great for processing many inbound emails and responding to other events at scale. Customize the payload sent to your endpoint by setting the requestBodyTemplate
property to a string with moustache style variables. Property names from the standard payload model for the given event are available as variables.
Implements
Inherited Members
Namespace: mailslurp.Model
Assembly: mailslurp.dll
Syntax
[DataContract(Name = "CreateWebhookOptions")]
public class CreateWebhookOptions : IValidatableObject
Constructors
View SourceCreateWebhookOptions()
Initializes a new instance of the CreateWebhookOptions class.
Declaration
[JsonConstructor]
protected CreateWebhookOptions()
CreateWebhookOptions(string, BasicAuthOptions, string, EventNameEnum?, WebhookHeaders, string, bool?, bool?, List<string>)
Initializes a new instance of the CreateWebhookOptions class.
Declaration
public CreateWebhookOptions(string url = null, BasicAuthOptions basicAuth = null, string name = null, CreateWebhookOptions.EventNameEnum? eventName = null, WebhookHeaders includeHeaders = null, string requestBodyTemplate = null, bool? useStaticIpRange = false, bool? ignoreInsecureSslCertificates = null, List<string> tags = null)
Parameters
Type | Name | Description |
---|---|---|
string | url | Public URL on your server that MailSlurp can post WebhookNotification payload to when an email is received or an event is trigger. The payload of the submitted JSON is dependent on the webhook event type. See docs.mailslurp.com/webhooks for event payload documentation. (required). |
BasicAuthOptions | basicAuth | basicAuth. |
string | name | Optional name for the webhook. |
CreateWebhookOptions.EventNameEnum? | eventName | Optional webhook event name. Default is |
WebhookHeaders | includeHeaders | includeHeaders. |
string | requestBodyTemplate | Template for the JSON body of the webhook request that will be sent to your server. Use Moustache style |
bool? | useStaticIpRange | Use static IP range when calling webhook endpoint (default to false). |
bool? | ignoreInsecureSslCertificates | Ignore insecure SSL certificates when sending request. Useful for self-signed certs.. |
List<string> | tags | Optional list of tags. |
Properties
View SourceBasicAuth
Gets or Sets BasicAuth
Declaration
[DataMember(Name = "basicAuth", EmitDefaultValue = true)]
public BasicAuthOptions BasicAuth { get; set; }
Property Value
Type | Description |
---|---|
BasicAuthOptions |
EventName
Optional webhook event name. Default is EMAIL_RECEIVED
and is triggered when an email is received by the inbox associated with the webhook. Payload differ according to the webhook event name.
Declaration
[DataMember(Name = "eventName", EmitDefaultValue = true)]
public CreateWebhookOptions.EventNameEnum? EventName { get; set; }
Property Value
Type | Description |
---|---|
CreateWebhookOptions.EventNameEnum? | Optional webhook event name. Default is |
IgnoreInsecureSslCertificates
Ignore insecure SSL certificates when sending request. Useful for self-signed certs.
Declaration
[DataMember(Name = "ignoreInsecureSslCertificates", EmitDefaultValue = true)]
public bool? IgnoreInsecureSslCertificates { get; set; }
Property Value
Type | Description |
---|---|
bool? | Ignore insecure SSL certificates when sending request. Useful for self-signed certs. |
IncludeHeaders
Gets or Sets IncludeHeaders
Declaration
[DataMember(Name = "includeHeaders", EmitDefaultValue = false)]
public WebhookHeaders IncludeHeaders { get; set; }
Property Value
Type | Description |
---|---|
WebhookHeaders |
Name
Optional name for the webhook
Declaration
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string | Optional name for the webhook |
RequestBodyTemplate
Template for the JSON body of the webhook request that will be sent to your server. Use Moustache style {{variableName}}
templating to use parts of the standard webhook payload for the given event.
Declaration
[DataMember(Name = "requestBodyTemplate", EmitDefaultValue = true)]
public string RequestBodyTemplate { get; set; }
Property Value
Type | Description |
---|---|
string | Template for the JSON body of the webhook request that will be sent to your server. Use Moustache style |
Tags
Optional list of tags
Declaration
[DataMember(Name = "tags", EmitDefaultValue = true)]
public List<string> Tags { get; set; }
Property Value
Type | Description |
---|---|
List<string> | Optional list of tags |
Url
Public URL on your server that MailSlurp can post WebhookNotification payload to when an email is received or an event is trigger. The payload of the submitted JSON is dependent on the webhook event type. See docs.mailslurp.com/webhooks for event payload documentation.
Declaration
[DataMember(Name = "url", IsRequired = true, EmitDefaultValue = true)]
public string Url { get; set; }
Property Value
Type | Description |
---|---|
string | Public URL on your server that MailSlurp can post WebhookNotification payload to when an email is received or an event is trigger. The payload of the submitted JSON is dependent on the webhook event type. See docs.mailslurp.com/webhooks for event payload documentation. |
UseStaticIpRange
Use static IP range when calling webhook endpoint
Declaration
[DataMember(Name = "useStaticIpRange", EmitDefaultValue = true)]
public bool? UseStaticIpRange { get; set; }
Property Value
Type | Description |
---|---|
bool? | Use static IP range when calling webhook endpoint |
Methods
View SourceToJson()
Returns the JSON string presentation of the object
Declaration
public virtual string ToJson()
Returns
Type | Description |
---|---|
string | JSON string presentation of the object |
ToString()
Returns the string presentation of the object
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | String presentation of the object |