AshDispatch.Info (AshDispatch v0.5.1)
View SourceIntrospection helpers for AshDispatch events.
This module provides functions to introspect event DSL configuration
at runtime. Generated automatically by Spark.InfoGenerator.
Usage
# Get event ID
AshDispatch.Info.dispatch_id(MyApp.Events.Orders.Created)
# => "orders.created"
# Get channels
AshDispatch.Info.dispatch_channels(MyApp.Events.Orders.Created)
# => [%Channel{transport: :email, audience: :user}, ...]
# Get domain
AshDispatch.Info.dispatch_domain(MyApp.Events.Orders.Created)
# => :ordersGenerated Functions
All DSL options and sections generate corresponding accessor functions:
Dispatch Section
dispatch_id/1- Event identifierdispatch_domain/1- Event domaindispatch_category/1- Email preference categorydispatch_user_configurable?/1- Whether user can opt-out
Channels Section
dispatch_channels/1- List of channel entities
Content Section
dispatch_content_subject/1- Email subject (if in DSL)dispatch_content_from_name/1- From namedispatch_content_from_email/1- From emaildispatch_content_notification_title/1- Notification titledispatch_content_notification_message/1- Notification messagedispatch_content_action_label/1- Action button labeldispatch_content_action_url/1- Action URL
Metadata Section
dispatch_metadata_action_required?/1- Whether action requireddispatch_metadata_notification_type/1- Notification type
Counters Section
dispatch_counters/1- List of counter broadcast configurations
Summary
Functions
Email preference category for user opt-out. Maps to UserEmailPreferences field. If nil, email is not user-configurable.
Email preference category for user opt-out. Maps to UserEmailPreferences field. If nil, email is not user-configurable.
dispatch.channels DSL entities
Action button label for in-app notifications
Action button label for in-app notifications
Action URL for in-app notifications. Supports {{variable}} interpolation.
Action URL for in-app notifications. Supports {{variable}} interpolation.
Email 'from' address (e.g., 'noreply@myapp.com')
Email 'from' address (e.g., 'noreply@myapp.com')
Email 'from' name (e.g., 'MyApp')
Email 'from' name (e.g., 'MyApp')
In-app notification message. Supports {{variable}} interpolation.
In-app notification message. Supports {{variable}} interpolation.
In-app notification title. Supports {{variable}} interpolation.
In-app notification title. Supports {{variable}} interpolation.
dispatch.content DSL options
Email subject line. Supports {{variable}} interpolation from prepare_template_assigns/2.
Email subject line. Supports {{variable}} interpolation from prepare_template_assigns/2.
dispatch.counters DSL entities
Domain this event belongs to (e.g., :orders, :tickets). Used for organization and filtering.
Domain this event belongs to (e.g., :orders, :tickets). Used for organization and filtering.
Unique event identifier (e.g., "orders.created"). If not provided, defaults to "{module_name_last_segment}".
Unique event identifier (e.g., "orders.created"). If not provided, defaults to "{module_name_last_segment}".
Ash filter expression to control visibility in manual trigger UI.
Ash filter expression to control visibility in manual trigger UI.
Whether this event requires user action
Notification type for styling in UI
Notification type for styling in UI
dispatch.metadata DSL options
dispatch DSL options
Field specification for extracting the recipient identifier (email, phone, etc.).
Field specification for extracting the recipient identifier (email, phone, etc.).
Field specification for extracting the recipient display name.
Field specification for extracting the recipient display name.
dispatch.recipient.discord DSL options
Field specification for extracting the recipient identifier (email, phone, etc.).
Field specification for extracting the recipient identifier (email, phone, etc.).
Field specification for extracting the recipient display name.
Field specification for extracting the recipient display name.
dispatch.recipient.email DSL options
Field specification for extracting the recipient identifier (email, phone, etc.).
Field specification for extracting the recipient identifier (email, phone, etc.).
Field specification for extracting the recipient display name.
Field specification for extracting the recipient display name.
dispatch.recipient.in_app DSL options
Field specification for extracting the recipient identifier (email, phone, etc.).
Field specification for extracting the recipient identifier (email, phone, etc.).
Field specification for extracting the recipient display name.
Field specification for extracting the recipient display name.
dispatch.recipient.slack DSL options
Field specification for extracting the recipient identifier (email, phone, etc.).
Field specification for extracting the recipient identifier (email, phone, etc.).
Field specification for extracting the recipient display name.
Field specification for extracting the recipient display name.
dispatch.recipient.sms DSL options
Field specification for extracting the recipient identifier (email, phone, etc.).
Field specification for extracting the recipient identifier (email, phone, etc.).
Field specification for extracting the recipient display name.
Field specification for extracting the recipient display name.
dispatch.recipient.webhook DSL options
Ash filter expression to control whether auto-triggered events should send.
Ash filter expression to control whether auto-triggered events should send.
Whether users can opt-out of this event via email preferences. Set to false for critical system emails (auth, password reset).
Functions
Email preference category for user opt-out. Maps to UserEmailPreferences field. If nil, email is not user-configurable.
Email preference category for user opt-out. Maps to UserEmailPreferences field. If nil, email is not user-configurable.
dispatch.channels DSL entities
@spec dispatch_content_action_label(dsl_or_extended :: module() | map()) :: {:ok, String.t()} | :error
Action button label for in-app notifications
@spec dispatch_content_action_label!(dsl_or_extended :: module() | map()) :: String.t() | no_return()
Action button label for in-app notifications
@spec dispatch_content_action_url(dsl_or_extended :: module() | map()) :: {:ok, String.t()} | :error
Action URL for in-app notifications. Supports {{variable}} interpolation.
Action URL for in-app notifications. Supports {{variable}} interpolation.
@spec dispatch_content_from_email(dsl_or_extended :: module() | map()) :: {:ok, String.t()} | :error
Email 'from' address (e.g., 'noreply@myapp.com')
Email 'from' address (e.g., 'noreply@myapp.com')
Email 'from' name (e.g., 'MyApp')
Email 'from' name (e.g., 'MyApp')
@spec dispatch_content_notification_message(dsl_or_extended :: module() | map()) :: {:ok, String.t()} | :error
In-app notification message. Supports {{variable}} interpolation.
@spec dispatch_content_notification_message!(dsl_or_extended :: module() | map()) :: String.t() | no_return()
In-app notification message. Supports {{variable}} interpolation.
@spec dispatch_content_notification_title(dsl_or_extended :: module() | map()) :: {:ok, String.t()} | :error
In-app notification title. Supports {{variable}} interpolation.
@spec dispatch_content_notification_title!(dsl_or_extended :: module() | map()) :: String.t() | no_return()
In-app notification title. Supports {{variable}} interpolation.
@spec dispatch_content_options(dsl_or_extended :: module() | map()) :: %{ required(atom()) => any() }
dispatch.content DSL options
Returns a map containing the and any configured or default values.
Email subject line. Supports {{variable}} interpolation from prepare_template_assigns/2.
Email subject line. Supports {{variable}} interpolation from prepare_template_assigns/2.
dispatch.counters DSL entities
Domain this event belongs to (e.g., :orders, :tickets). Used for organization and filtering.
Domain this event belongs to (e.g., :orders, :tickets). Used for organization and filtering.
Unique event identifier (e.g., "orders.created"). If not provided, defaults to "{module_name_last_segment}".
Unique event identifier (e.g., "orders.created"). If not provided, defaults to "{module_name_last_segment}".
Ash filter expression to control visibility in manual trigger UI.
Filters are applied to the target user (recipient) to determine if this event should be shown as an option in manual trigger interfaces.
Examples
# Only show if user hasn't confirmed email
manual_trigger_filter: [confirmed_at: nil]
# Only show if user is archived
manual_trigger_filter: [archived_at: [not: nil]]
# Complex filter with multiple conditions
manual_trigger_filter: [admin: true, archived: false]Defaults to no filter (show for all users). For complex logic, override
the applicable_for_user?/1 callback instead.
Ash filter expression to control visibility in manual trigger UI.
Filters are applied to the target user (recipient) to determine if this event should be shown as an option in manual trigger interfaces.
Examples
# Only show if user hasn't confirmed email
manual_trigger_filter: [confirmed_at: nil]
# Only show if user is archived
manual_trigger_filter: [archived_at: [not: nil]]
# Complex filter with multiple conditions
manual_trigger_filter: [admin: true, archived: false]Defaults to no filter (show for all users). For complex logic, override
the applicable_for_user?/1 callback instead.
Whether this event requires user action
@spec dispatch_metadata_notification_type(dsl_or_extended :: module() | map()) :: {:ok, :error | :warning | :success | :info} | :error
Notification type for styling in UI
@spec dispatch_metadata_notification_type!(dsl_or_extended :: module() | map()) :: (:error | :warning | :success | :info) | no_return()
Notification type for styling in UI
@spec dispatch_metadata_options(dsl_or_extended :: module() | map()) :: %{ required(atom()) => any() }
dispatch.metadata DSL options
Returns a map containing the and any configured or default values.
dispatch DSL options
Returns a map containing the and any configured or default values.
@spec dispatch_recipient_discord_identifier(dsl_or_extended :: module() | map()) :: {:ok, any()} | :error
Field specification for extracting the recipient identifier (email, phone, etc.).
Formats:
:field_name- Direct field access{:field, :field_name}- Explicit field{:field, [:nested, :path]}- Nested path{:string_field, "key"}- String key&Module.function/1- Custom function
@spec dispatch_recipient_discord_identifier!(dsl_or_extended :: module() | map()) :: any() | no_return()
Field specification for extracting the recipient identifier (email, phone, etc.).
Formats:
:field_name- Direct field access{:field, :field_name}- Explicit field{:field, [:nested, :path]}- Nested path{:string_field, "key"}- String key&Module.function/1- Custom function
Field specification for extracting the recipient display name.
Formats: Same as identifier.
Set to nil if name is not needed (e.g., webhooks).
Field specification for extracting the recipient display name.
Formats: Same as identifier.
Set to nil if name is not needed (e.g., webhooks).
@spec dispatch_recipient_discord_options(dsl_or_extended :: module() | map()) :: %{ required(atom()) => any() }
dispatch.recipient.discord DSL options
Returns a map containing the and any configured or default values.
@spec dispatch_recipient_email_identifier(dsl_or_extended :: module() | map()) :: {:ok, any()} | :error
Field specification for extracting the recipient identifier (email, phone, etc.).
Formats:
:field_name- Direct field access{:field, :field_name}- Explicit field{:field, [:nested, :path]}- Nested path{:string_field, "key"}- String key&Module.function/1- Custom function
@spec dispatch_recipient_email_identifier!(dsl_or_extended :: module() | map()) :: any() | no_return()
Field specification for extracting the recipient identifier (email, phone, etc.).
Formats:
:field_name- Direct field access{:field, :field_name}- Explicit field{:field, [:nested, :path]}- Nested path{:string_field, "key"}- String key&Module.function/1- Custom function
Field specification for extracting the recipient display name.
Formats: Same as identifier.
Set to nil if name is not needed (e.g., webhooks).
Field specification for extracting the recipient display name.
Formats: Same as identifier.
Set to nil if name is not needed (e.g., webhooks).
@spec dispatch_recipient_email_options(dsl_or_extended :: module() | map()) :: %{ required(atom()) => any() }
dispatch.recipient.email DSL options
Returns a map containing the and any configured or default values.
@spec dispatch_recipient_in_app_identifier(dsl_or_extended :: module() | map()) :: {:ok, any()} | :error
Field specification for extracting the recipient identifier (email, phone, etc.).
Formats:
:field_name- Direct field access{:field, :field_name}- Explicit field{:field, [:nested, :path]}- Nested path{:string_field, "key"}- String key&Module.function/1- Custom function
@spec dispatch_recipient_in_app_identifier!(dsl_or_extended :: module() | map()) :: any() | no_return()
Field specification for extracting the recipient identifier (email, phone, etc.).
Formats:
:field_name- Direct field access{:field, :field_name}- Explicit field{:field, [:nested, :path]}- Nested path{:string_field, "key"}- String key&Module.function/1- Custom function
Field specification for extracting the recipient display name.
Formats: Same as identifier.
Set to nil if name is not needed (e.g., webhooks).
Field specification for extracting the recipient display name.
Formats: Same as identifier.
Set to nil if name is not needed (e.g., webhooks).
@spec dispatch_recipient_in_app_options(dsl_or_extended :: module() | map()) :: %{ required(atom()) => any() }
dispatch.recipient.in_app DSL options
Returns a map containing the and any configured or default values.
@spec dispatch_recipient_slack_identifier(dsl_or_extended :: module() | map()) :: {:ok, any()} | :error
Field specification for extracting the recipient identifier (email, phone, etc.).
Formats:
:field_name- Direct field access{:field, :field_name}- Explicit field{:field, [:nested, :path]}- Nested path{:string_field, "key"}- String key&Module.function/1- Custom function
@spec dispatch_recipient_slack_identifier!(dsl_or_extended :: module() | map()) :: any() | no_return()
Field specification for extracting the recipient identifier (email, phone, etc.).
Formats:
:field_name- Direct field access{:field, :field_name}- Explicit field{:field, [:nested, :path]}- Nested path{:string_field, "key"}- String key&Module.function/1- Custom function
Field specification for extracting the recipient display name.
Formats: Same as identifier.
Set to nil if name is not needed (e.g., webhooks).
Field specification for extracting the recipient display name.
Formats: Same as identifier.
Set to nil if name is not needed (e.g., webhooks).
@spec dispatch_recipient_slack_options(dsl_or_extended :: module() | map()) :: %{ required(atom()) => any() }
dispatch.recipient.slack DSL options
Returns a map containing the and any configured or default values.
@spec dispatch_recipient_sms_identifier(dsl_or_extended :: module() | map()) :: {:ok, any()} | :error
Field specification for extracting the recipient identifier (email, phone, etc.).
Formats:
:field_name- Direct field access{:field, :field_name}- Explicit field{:field, [:nested, :path]}- Nested path{:string_field, "key"}- String key&Module.function/1- Custom function
@spec dispatch_recipient_sms_identifier!(dsl_or_extended :: module() | map()) :: any() | no_return()
Field specification for extracting the recipient identifier (email, phone, etc.).
Formats:
:field_name- Direct field access{:field, :field_name}- Explicit field{:field, [:nested, :path]}- Nested path{:string_field, "key"}- String key&Module.function/1- Custom function
Field specification for extracting the recipient display name.
Formats: Same as identifier.
Set to nil if name is not needed (e.g., webhooks).
Field specification for extracting the recipient display name.
Formats: Same as identifier.
Set to nil if name is not needed (e.g., webhooks).
@spec dispatch_recipient_sms_options(dsl_or_extended :: module() | map()) :: %{ required(atom()) => any() }
dispatch.recipient.sms DSL options
Returns a map containing the and any configured or default values.
@spec dispatch_recipient_webhook_identifier(dsl_or_extended :: module() | map()) :: {:ok, any()} | :error
Field specification for extracting the recipient identifier (email, phone, etc.).
Formats:
:field_name- Direct field access{:field, :field_name}- Explicit field{:field, [:nested, :path]}- Nested path{:string_field, "key"}- String key&Module.function/1- Custom function
@spec dispatch_recipient_webhook_identifier!(dsl_or_extended :: module() | map()) :: any() | no_return()
Field specification for extracting the recipient identifier (email, phone, etc.).
Formats:
:field_name- Direct field access{:field, :field_name}- Explicit field{:field, [:nested, :path]}- Nested path{:string_field, "key"}- String key&Module.function/1- Custom function
Field specification for extracting the recipient display name.
Formats: Same as identifier.
Set to nil if name is not needed (e.g., webhooks).
Field specification for extracting the recipient display name.
Formats: Same as identifier.
Set to nil if name is not needed (e.g., webhooks).
@spec dispatch_recipient_webhook_options(dsl_or_extended :: module() | map()) :: %{ required(atom()) => any() }
dispatch.recipient.webhook DSL options
Returns a map containing the and any configured or default values.
Ash filter expression to control whether auto-triggered events should send.
Filters are applied to the target user (recipient) to determine if this auto-triggered event should actually be sent to them.
Examples
# Only send if user hasn't confirmed email yet
should_send_filter: [confirmed_at: nil]
# Only send to active, non-archived users
should_send_filter: [archived_at: nil, active: true]Defaults to no filter (always send). For complex logic, override
the should_send?/2 callback instead.
Note: This filter is only checked for auto-triggered events. Manual triggers always send (assuming applicable_for_user? returns true).
Ash filter expression to control whether auto-triggered events should send.
Filters are applied to the target user (recipient) to determine if this auto-triggered event should actually be sent to them.
Examples
# Only send if user hasn't confirmed email yet
should_send_filter: [confirmed_at: nil]
# Only send to active, non-archived users
should_send_filter: [archived_at: nil, active: true]Defaults to no filter (always send). For complex logic, override
the should_send?/2 callback instead.
Note: This filter is only checked for auto-triggered events. Manual triggers always send (assuming applicable_for_user? returns true).
Whether users can opt-out of this event via email preferences. Set to false for critical system emails (auth, password reset).