IEmailTemplateService
Defines the Vendr Email Template service
public interface IEmailTemplateService : ICachedEntityService<EmailTemplateReadOnly>, IService
Inheritance
- interface ICachedEntityService<TEntityType>
- interface IService
Namespace
Methods
DeleteEmailTemplate (1 of 2)
Deletes a EmailTemplate
public void DeleteEmailTemplate(Guid id)
Parameters
Parameter | Description |
---|---|
id |
The ID of the EmailTemplate to delete |
DeleteEmailTemplate (2 of 2)
Deletes a EmailTemplate
public void DeleteEmailTemplate(EmailTemplate entity)
Parameters
Parameter | Description |
---|---|
entity |
The EmailTemplate to delete |
EmailTemplateExists
Check to see if a EmailTemplateReadOnly
exists in the given Store
with the given Alias
public bool EmailTemplateExists(Guid storeId, string alias)
Parameters
Parameter | Description |
---|---|
storeId |
The ID of the Store the EmailTemplateReadOnly entity belongs to |
alias |
The Alias of the EmailTemplateReadOnly entity to check |
Returns
Returns true
if the EmailTemplateReadOnly
exists, otherwise returns false
.
GetEmailTemplate (1 of 2)
Get a EmailTemplateReadOnly
entity by ID
public EmailTemplateReadOnly GetEmailTemplate(Guid id)
Parameters
Parameter | Description |
---|---|
id |
The ID of the EmailTemplateReadOnly entity to fetch |
Returns
A EmailTemplateReadOnly
entity
GetEmailTemplate (2 of 2)
Get a EmailTemplateReadOnly
entity by Store
and Alias
public EmailTemplateReadOnly GetEmailTemplate(Guid storeId, string alias)
Parameters
Parameter | Description |
---|---|
storeId |
The ID of the Store the EmailTemplateReadOnly entity belongs to |
alias |
The Alias of the EmailTemplateReadOnly entity to fetch |
Returns
A EmailTemplateReadOnly
entity
GetEmailTemplates (1 of 2)
Get a list of all EmailTemplateReadOnly
entities from the given Store
public IEnumerable<EmailTemplateReadOnly> GetEmailTemplates(Guid storeId)
Parameters
Parameter | Description |
---|---|
storeId |
The ID of the Store the EmailTemplateReadOnly entities belong to |
Returns
A list of EmailTemplateReadOnly
entities
GetEmailTemplates (2 of 2)
Get a list of EmailTemplateReadOnly
entities with the given IDs
public IEnumerable<EmailTemplateReadOnly> GetEmailTemplates(Guid[] ids)
Parameters
Parameter | Description |
---|---|
ids |
The IDs of the EmailTemplateReadOnly entities to fetch |
Returns
A list of EmailTemplateReadOnly
entities
SaveEmailTemplate
Saves a EmailTemplate
public void SaveEmailTemplate(EmailTemplate entity)
Parameters
Parameter | Description |
---|---|
entity |
The EmailTemplate to save |
SendEmail
Sends an email using the given EmailTemplate
to an Order
customer using the Order
as the EmailTemplate
model
public bool SendEmail(EmailTemplateReadOnly emailTemplate, OrderReadOnly order)
Parameters
Parameter | Description |
---|---|
emailTemplate |
The EmailTemplate to send |
order |
The Order to use as the EmailTemplate model and from which to access the Customer email address to send the email to |
Returns
Returns true
if the send was successful, otherwise returns false
.
SendEmail<TModel>
Sends an email using the given EmailTemplate
to the given email address, using the given model
public bool SendEmail<TModel>(EmailTemplateReadOnly emailTemplate, TModel model,
string toEmailAddress, string languageIsoCode)
Parameters
Parameter | Description |
---|---|
TModel |
The Type of the model for the EmailTemplate |
emailTemplate |
The EmailTemplate to send |
model |
The model instance for the EmailTemplate |
toEmailAddress |
The email address to send the email to |
languageIsoCode |
The ISO Code of the language to send the email in |
Returns
Returns true
if the send was successful, otherwise returns false
.
SortEmailTemplates
Sorts a list of EmailTemplate
entities by ID according to the order of those IDs
public void SortEmailTemplates(Guid[] sortedIds)
Parameters
Parameter | Description |
---|---|
sortedIds |
The IDs of the EmailTemplate entities to sort, in the order by which to sort them |