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
httpClientHttpClienturiUri
Methods
DeleteAsync(CancellationToken)
Deletes the EmailTemplate resource asynchronously.
public Task DeleteAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA 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
cancellationTokenCancellationTokenA 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
resourceEmailTemplateThe resource data to be sent in the patch request.
cancellationTokenCancellationTokenA 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
documentJsonApiDocument<EmailTemplateResource>The JSON:API document to be sent in the patch request.
cancellationTokenCancellationTokenA 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
cancellationTokenCancellationToken