StrawHat.Mailer v0.4.4 StrawHat.Mailer.Template View Source
Interactor module that defines all the functionality for template management.
Link to this section Summary
Functions
Add a partial to the template
Add partials to template
Create a template
Destroy a template
Get a template by id
Get a template by id
Get a template by name
Get the list of templates
Remove a partial from the template
Update a template
Link to this section Functions
Link to this function
add_partial(template, partial)
View Source
add_partial( StrawHat.Mailer.Schema.Template.t(), StrawHat.Mailer.Schema.Partial.t() ) :: {:ok, StrawHat.Mailer.Schema.TemplatePartial.t()} | {:error, Ecto.Changeset.t()}
Add a partial to the template.
Link to this function
add_partials(template, partials)
View Source
add_partials(StrawHat.Mailer.Schema.Template.t(), [ StrawHat.Mailer.Schema.Partial.t() ]) :: [ok: StrawHat.Mailer.Schema.Template.t(), error: Ecto.Changeset.t()]
Add partials to template.
Link to this function
create_template(template_attrs)
View Source
create_template(StrawHat.Mailer.Schema.Template.template_attrs()) :: {:ok, StrawHat.Mailer.Schema.Template.t()} | {:error, Ecto.Changeset.t()}
Create a template.
Link to this function
destroy_template(template)
View Source
destroy_template(StrawHat.Mailer.Schema.Template.t()) :: {:ok, StrawHat.Mailer.Schema.Template.t()} | {:error, Ecto.Changeset.t()}
Destroy a template.
Link to this function
find_template(template_id)
View Source
find_template(String.t()) :: {:ok, StrawHat.Mailer.Schema.Template.t()} | {:error, StrawHat.Error.t()}
Get a template by id
.
Link to this function
get_template(template_id)
View Source
get_template(String.t()) :: Ecto.Schema.t() | nil | no_return()
Get a template by id
.
Link to this function
get_template_by_name(template_name)
View Source
get_template_by_name(String.t()) :: {:ok, StrawHat.Mailer.Schema.Template.t()} | {:error, StrawHat.Error.t()}
Get a template by name
.
Link to this function
get_templates(pagination \\ [])
View Source
get_templates(Scrivener.Config.t()) :: Scrivener.Page.t()
Get the list of templates.
Link to this function
remove_partial(template, partial)
View Source
remove_partial( StrawHat.Mailer.Schema.Template.t(), StrawHat.Mailer.Schema.Partial.t() ) :: {:ok, StrawHat.Mailer.Schema.TemplatePartial.t()} | {:error, Ecto.Changeset.t() | StrawHat.Error.t()}
Remove a partial from the template.
Link to this function
update_template(template, template_attrs)
View Source
update_template( StrawHat.Mailer.Schema.Template.t(), StrawHat.Mailer.Schema.Template.template_attrs() ) :: {:ok, StrawHat.Mailer.Schema.Template.t()} | {:error, Ecto.Changeset.t()}
Update a template.