Table of Contents

Class ProviderClient

Namespace
Auth0.ManagementApi.Emails
Assembly
Auth0.ManagementApi.dll
public class ProviderClient : IProviderClient
Inheritance
ProviderClient
Implements
Inherited Members
Extension Methods

Methods

CreateAsync(CreateEmailProviderRequestContent, RequestOptions?, CancellationToken)

Create an email provider. The credentials object requires different properties depending on the email provider (which is specified using the name property):

  • mandrill requires api_key
  • sendgrid requires api_key
  • sparkpost requires api_key. Optionally, set region to eu to use the SparkPost service hosted in Western Europe; set to null to use the SparkPost service hosted in North America. eu or null are the only valid values for region.
  • mailgun requires api_key and domain. Optionally, set region to eu to use the Mailgun service hosted in Europe; set to null otherwise. eu or null are the only valid values for region.
  • ses requires accessKeyId, secretAccessKey, and region
  • smtp requires smtp_host, smtp_port, smtp_user, and smtp_pass

Depending on the type of provider it is possible to specify settings object with different configuration options, which will be used when sending an email:

  • smtp provider, settings may contain headers object.
    <ul><li>
        When using AWS SES SMTP host, you may provide a name of configuration set in
        <code>X-SES-Configuration-Set</code> header. Value must be a string.
      </li><li>
        When using Sparkpost host, you may provide value for
        <code>X-MSYS_API</code> header. Value must be an object.
      </li></ul>
    
  • for ses provider, settings may contain message object, where you can provide a name of configuration set in configuration_set_name property. Value must be a string.
public WithRawResponseTask<CreateEmailProviderResponseContent> CreateAsync(CreateEmailProviderRequestContent request, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

request CreateEmailProviderRequestContent
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<CreateEmailProviderResponseContent>

Examples

await client.Emails.Provider.CreateAsync(
    new CreateEmailProviderRequestContent
    {
        Name = EmailProviderNameEnum.Mailgun,
        Credentials = new EmailProviderCredentialsSchemaZero { ApiKey = "api_key" },
    }
);

DeleteAsync(RequestOptions?, CancellationToken)

Delete the email provider.

public Task DeleteAsync(RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

options RequestOptions
cancellationToken CancellationToken

Returns

Task

Examples

await client.Emails.Provider.DeleteAsync();

GetAsync(GetEmailProviderRequestParameters, RequestOptions?, CancellationToken)

Retrieve details of the email provider configuration in your tenant. A list of fields to include or exclude may also be specified.

public WithRawResponseTask<GetEmailProviderResponseContent> GetAsync(GetEmailProviderRequestParameters request, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

request GetEmailProviderRequestParameters
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<GetEmailProviderResponseContent>

Examples

await client.Emails.Provider.GetAsync(
    new GetEmailProviderRequestParameters { Fields = "fields", IncludeFields = true }
);

UpdateAsync(UpdateEmailProviderRequestContent, RequestOptions?, CancellationToken)

Update an email provider. The credentials object requires different properties depending on the email provider (which is specified using the name property):

  • mandrill requires api_key
  • sendgrid requires api_key
  • sparkpost requires api_key. Optionally, set region to eu to use the SparkPost service hosted in Western Europe; set to null to use the SparkPost service hosted in North America. eu or null are the only valid values for region.
  • mailgun requires api_key and domain. Optionally, set region to eu to use the Mailgun service hosted in Europe; set to null otherwise. eu or null are the only valid values for region.
  • ses requires accessKeyId, secretAccessKey, and region
  • smtp requires smtp_host, smtp_port, smtp_user, and smtp_pass

Depending on the type of provider it is possible to specify settings object with different configuration options, which will be used when sending an email:

  • smtp provider, settings may contain headers object.
    <ul><li>
        When using AWS SES SMTP host, you may provide a name of configuration set in
        <code>X-SES-Configuration-Set</code> header. Value must be a string.
      </li><li>
        When using Sparkpost host, you may provide value for
        <code>X-MSYS_API</code> header. Value must be an object.
      </li></ul>
    
    for <code>ses</code> provider, <code>settings</code> may contain <code>message</code> object, where you can provide
    a name of configuration set in <code>configuration_set_name</code> property. Value must be a string.
    
public WithRawResponseTask<UpdateEmailProviderResponseContent> UpdateAsync(UpdateEmailProviderRequestContent request, RequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

request UpdateEmailProviderRequestContent
options RequestOptions
cancellationToken CancellationToken

Returns

WithRawResponseTask<UpdateEmailProviderResponseContent>

Examples

await client.Emails.Provider.UpdateAsync(new UpdateEmailProviderRequestContent());