View Source StepFlow.NotificationHooks.NotificationTemplates (StepFlow v1.8.0)
The Notification templates context.
Summary
Functions
Creates a notification_template.
Deletes a NotificationTemplate.
Gets a single notification_template.
Gets a single notification_template by template_name.
Returns the list of notification templates.
Updates NotificationTemplate.
Functions
Creates a notification_template.
Examples
iex> create_notification_template(%
{
template_name: template_name_value,
template_headers: template_headers_value,
template_body: template_body_value
})
{:ok, %NotificationTemplate{}}
iex> create_notification_template(%
{
template_name: duplicate_template_name_value,
template_headers: template_headers_value,
template_body: template_body_value
})
{:error, %Ecto.Changeset{}}
Deletes a NotificationTemplate.
Examples
iex> delete_notification_template(notification_template)
{:ok, %NotificationTemplate{}}
iex> delete_notification_template(notification_template)
{:error, %Ecto.Changeset{}}
Gets a single notification_template.
Raises Ecto.NoResultsError
if the notification_template does not exist.
Examples
iex> get_notification_template!(123)
%NotificationTemplate{}
iex> get_notification_template!(456)
** (Ecto.NoResultsError)
Gets a single notification_template by template_name.
Examples
iex> get_notification_template_by_name("MY_NAME")
%NotificationTemplate{}
iex> get_notification_template_by_name("BAD_NAME")
nil
Returns the list of notification templates.
Examples
iex> list_notification_templates()
[%NotificationTemplate{}, ...]
Updates NotificationTemplate.
Examples
iex> update_notification_template(notification_template, %{field: new_value})
{:ok, %NotificationTemplate{}}
iex> update_notification_template(notification_template, %{field: bad_value})
{:error, %Ecto.Changeset{}}