### Start Yugo.Client in Elixir Application Supervision Tree Source: https://github.com/flying-toast/yugo/blob/master/README.md This snippet demonstrates how to integrate `Yugo.Client` into an Elixir application's supervision tree. It shows the basic setup for starting the client with a given name, IMAP server address, username, and password, ensuring it's managed by the application supervisor. ```elixir defmodule MyApp.Application do use Application @impl true def start(_type, _args) do children = [ {Yugo.Client, name: :example_client, server: "imap.example.com", username: "me@example.com", password: "pa55w0rd"} ] Supervisor.start_link(children, strategy: :one_for_one) end end ``` -------------------------------- ### Subscribe to Filtered Emails with Yugo in Elixir Source: https://github.com/flying-toast/yugo/blob/master/README.md This example illustrates how to subscribe to email notifications using `Yugo.subscribe/2` with a custom filter. It defines a filter to match subjects containing 'hello' or 'goodbye' and then shows how to receive and inspect incoming email messages that match the criteria. ```elixir # filter to only notify us about messages containing "hello" or "goodbye" in the subject: my_filter = Yugo.Filter.all() |> Yugo.Filter.subject_matches(~r/(hello|goodbye)/) # By subscribing, our process will be notified about all future emails that match the filter. Yugo.subscribe(:example_client, my_filter) receive do {:email, _client, message} -> IO.puts("Received an email with subject `#{message.subject}`:") IO.inspect(message) end ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.