StrawHat.Mailer v1.0.0 StrawHat.Mailer.Templates View Source
Interactor module that defines all the functionality for template management.
Link to this section Summary
Functions
Adds a partial to the template
Adds partials to template
Returns an %Ecto.Changeset{}
for tracking template changes
Creates a template
Destroys a template
Gets a template by id
Gets a template by id
Gets a template by name
Returns the list of templates
Removes a partial from the template
Updates a template
Link to this section Functions
Link to this function
add_partial(template, partial)
View Source
add_partial(StrawHat.Mailer.Template.t(), StrawHat.Mailer.Partial.t()) :: {:ok, StrawHat.Mailer.TemplatePartial.t()} | {:error, Ecto.Changeset.t()}
Adds a partial to the template.
Link to this function
add_partials(template, partials)
View Source
add_partials(StrawHat.Mailer.Template.t(), [StrawHat.Mailer.Partial.t()]) :: [ ok: StrawHat.Mailer.Template.t(), error: Ecto.Changeset.t() ]
Adds partials to template.
Link to this function
change_template(template)
View Source
change_template(StrawHat.Mailer.Template.t()) :: Ecto.Changeset.t()
Returns an %Ecto.Changeset{}
for tracking template changes.
Link to this function
create_template(template_attrs)
View Source
create_template(StrawHat.Mailer.Template.template_attrs()) :: {:ok, StrawHat.Mailer.Template.t()} | {:error, Ecto.Changeset.t()}
Creates a template.
Link to this function
destroy_template(template)
View Source
destroy_template(StrawHat.Mailer.Template.t()) :: {:ok, StrawHat.Mailer.Template.t()} | {:error, Ecto.Changeset.t()}
Destroys a template.
Link to this function
find_template(template_id)
View Source
find_template(String.t()) :: {:ok, StrawHat.Mailer.Template.t()} | {:error, StrawHat.Error.t()}
Gets a template by id
.
Link to this function
get_template(template_id)
View Source
get_template(String.t()) :: Ecto.Schema.t() | nil | no_return()
Gets 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.Template.t()} | {:error, StrawHat.Error.t()}
Gets a template by name
.
Link to this function
get_templates(pagination \\ [])
View Source
get_templates(Scrivener.Config.t()) :: Scrivener.Page.t()
Returns the list of templates.
Link to this function
remove_partial(template, partial)
View Source
remove_partial(StrawHat.Mailer.Template.t(), StrawHat.Mailer.Partial.t()) :: {:ok, StrawHat.Mailer.TemplatePartial.t()} | {:error, Ecto.Changeset.t() | StrawHat.Error.t()}
Removes a partial from the template.
Link to this function
update_template(template, template_attrs)
View Source
update_template( StrawHat.Mailer.Template.t(), StrawHat.Mailer.Template.template_attrs() ) :: {:ok, StrawHat.Mailer.Template.t()} | {:error, Ecto.Changeset.t()}
Updates a template.