Specify default values for your function parameters using \\:

defmodule Bob do
  def say(message \\ "Hi, I'm Bob!") do
    "Bob says: #{message}"
  end	
end
iex> Bob.say
"Bob says: Hi, I'm Bob!"
iex> Bob.say "Morning!"
"Bob says: Morning!"

Do be careful if you’re using optional parameters when definining functions of the same name but different arity. Since named functions in Elixir are identified by its name and arity, optional parameters can lead to some ambiguity. Elixir will warn you if your function definitions conflict.