Table of Contents

Class EmailTemplateClient

Namespace
Crews.PlanningCenter.Api.Services.V2018_08_01
Assembly
Crews.PlanningCenter.Api.dll

Client for interacting with the EmailTemplate resource.

public class EmailTemplateClient : SingletonResourceClient<EmailTemplate, EmailTemplateResource, EmailTemplateResponse>
Inheritance
EmailTemplateClient
Inherited Members

Constructors

EmailTemplateClient(HttpClient, Uri)

Client for interacting with the EmailTemplate resource.

public EmailTemplateClient(HttpClient httpClient, Uri uri)

Parameters

httpClient HttpClient
uri Uri

Methods

AddCustomParameter(string, string)

Adds a custom query parameter to the request URI.

public EmailTemplateClient AddCustomParameter(string parameter, string value)

Parameters

parameter string

The name of the query parameter.

value string

The value of the query parameter.

Returns

EmailTemplateClient

The current EmailTemplateClient instance.

ClearParameters()

Removes the entire query string from the request URI.

public EmailTemplateClient ClearParameters()

Returns

EmailTemplateClient

The current EmailTemplateClient instance.

DeleteAsync(CancellationToken)

Deletes the EmailTemplate resource asynchronously.

public Task DeleteAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task

A task representing the asynchronous delete operation.

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

GetAsync(CancellationToken)

Fetches the EmailTemplate resource asynchronously.

public Task<EmailTemplateResponse> GetAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<EmailTemplateResponse>

A task representing the asynchronous operation, containing the EmailTemplate resource.

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

PatchAsync(EmailTemplate, CancellationToken)

Updates an existing EmailTemplate resource asynchronously.

public Task<EmailTemplateResponse> PatchAsync(EmailTemplate resource, CancellationToken cancellationToken = default)

Parameters

resource EmailTemplate

The resource data to be sent in the patch request.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<EmailTemplateResponse>

A task representing the asynchronous operation, containing the updated EmailTemplate resource.

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

PatchAsync(JsonApiDocument<EmailTemplateResource>, CancellationToken)

Updates an existing EmailTemplate resource asynchronously.

public Task<EmailTemplateResponse> PatchAsync(JsonApiDocument<EmailTemplateResource> document, CancellationToken cancellationToken = default)

Parameters

document JsonApiDocument<EmailTemplateResource>

The JSON:API document to be sent in the patch request.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<EmailTemplateResponse>

A task representing the asynchronous operation, containing the updated EmailTemplate resource.

Exceptions

JsonApiException

Thrown when the HTTP response indicates a failure status code.

RenderAsync(CancellationToken)

Render an email template and fill in the persons details
Render the template with information from the person.

<code>json<br />{<br /> "data": {<br /> "attributes": {<br /> "format": "html|text"<br /> },<br /> "relationships": {<br /> "person": {<br /> "data": {<br /> "type": "Person",<br /> "id": "1"<br /> }<br /> }<br /> }<br /> }<br />}<br /></code>

public Task RenderAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task