Class TemplateService
Inheritance
TemplateService
Assembly: OEMS.UI.dll
Syntax
public class TemplateService
Constructors
TemplateService(HttpClient)
Declaration
public TemplateService(HttpClient httpClient)
Parameters
Methods
CreateEmailTemplateAsync(CreateEmailTemplateDto, Guid)
Creates a new email template in the system.
Declaration
public Task<Guid> CreateEmailTemplateAsync(CreateEmailTemplateDto dto, Guid userId)
Parameters
Returns
Type |
Description |
Task<Guid> |
The unique identifier (Guid) of the newly created email template.
|
Exceptions
CreateProcessStepTemplateAsync(CreateProcessStepTemplateDto)
Declaration
public Task<Guid> CreateProcessStepTemplateAsync(CreateProcessStepTemplateDto dto)
Parameters
Returns
CreateProcessTemplateAsync(CreateProcessTemplateDto)
Declaration
public Task<Guid> CreateProcessTemplateAsync(CreateProcessTemplateDto dto)
Parameters
Returns
DeleteEmailTemplateAsync(Guid)
Deletes an email template from the system by its unique identifier.
Declaration
public Task DeleteEmailTemplateAsync(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
The unique identifier of the email template to delete.
|
Returns
Type |
Description |
Task |
A Task representing the asynchronous operation.
|
Exceptions
DeleteProcessStepTemplateAsync(Guid)
Declaration
public Task DeleteProcessStepTemplateAsync(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
DeleteProcessTemplateAsync(Guid)
Declaration
public Task DeleteProcessTemplateAsync(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
GetEmailTemplateByIdAsync(Guid)
Retrieves a specific email template by its unique identifier.
Declaration
public Task<EmailTemplateDto> GetEmailTemplateByIdAsync(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
The unique identifier of the email template to retrieve.
|
Returns
Exceptions
Type |
Condition |
HttpRequestException |
Thrown when there is an error in the HTTP request.
|
JsonException |
Thrown when the response cannot be deserialized into an EmailTemplateDto.
|
GetEmailTemplatesAsync(Guid, Guid)
Retrieves all email templates for a specified organization.
Declaration
public Task<IEnumerable<EmailTemplateDto>> GetEmailTemplatesAsync(Guid organizationId, Guid userId)
Parameters
Type |
Name |
Description |
Guid |
organizationId |
The unique identifier of the organization whose email templates should be retrieved.
|
Guid |
userId |
The unique identifier of the user requesting the templates.
|
Returns
Exceptions
GetProcessStepTemplateByIdAsync(Guid)
Declaration
public Task<ProcessStepTemplateDto> GetProcessStepTemplateByIdAsync(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
GetProcessStepTemplatesAsync(Guid)
Declaration
public Task<IEnumerable<ProcessStepTemplateDto>> GetProcessStepTemplatesAsync(Guid processTemplateId)
Parameters
Type |
Name |
Description |
Guid |
processTemplateId |
|
Returns
GetProcessTemplateByIdAsync(Guid)
Declaration
public Task<ProcessTemplateDto> GetProcessTemplateByIdAsync(Guid id)
Parameters
Type |
Name |
Description |
Guid |
id |
|
Returns
GetProcessTemplatesAsync(Guid)
Declaration
public Task<IEnumerable<ProcessTemplateDto>> GetProcessTemplatesAsync(Guid organizationId)
Parameters
Type |
Name |
Description |
Guid |
organizationId |
|
Returns
UpdateEmailTemplateAsync(UpdateEmailTemplateDto)
Updates an existing email template with new information.
Declaration
public Task UpdateEmailTemplateAsync(UpdateEmailTemplateDto dto)
Parameters
Returns
Type |
Description |
Task |
A Task representing the asynchronous operation.
|
Exceptions
UpdateProcessStepTemplateAsync(UpdateProcessStepTemplateDto)
Declaration
public Task UpdateProcessStepTemplateAsync(UpdateProcessStepTemplateDto dto)
Parameters
Returns
UpdateProcessStepTemplateSequenceAsync(Guid, int)
Declaration
public Task UpdateProcessStepTemplateSequenceAsync(Guid id, int newSequence)
Parameters
Type |
Name |
Description |
Guid |
id |
|
int |
newSequence |
|
Returns
UpdateProcessTemplateAsync(UpdateProcessTemplateDto)
Declaration
public Task UpdateProcessTemplateAsync(UpdateProcessTemplateDto dto)
Parameters
Returns