Glossia.Environment (glossia v0.3.1)

Glossia is configured at runtime using environment variables. This module provides an interface to read and validate the configuration. All the configuration env. variables are scoped under the GLOSSIA_ prefix.

Summary

Functions

check_missing_email_env_variables(missing_env_variables \\ [], env \\ System.get_env())

email_adapter(env \\ System.get_env())

Returns the email adapter to use.

Parameters

  • env - The environment variables to use. Defaults to System.get_env().

Returns

  • :smtp - The SMTP adapter.

Raises

email_smtp_auth(env \\ System.get_env())

Returns the SMTP authentication to use.

Parameters

  • env - The environment variables to use. Defaults to System.get_env().

Returns

  • atom() - The SMTP authentication.

Example

iex> Glossia.Environment.email_smtp_auth() :always

email_smtp_no_mx_lookups(env \\ System.get_env())

Returns whether to use no MX lookups.

Parameters

  • env - The environment variables to use. Defaults to System.get_env().

Returns

  • boolean() - Whether to use no MX lookups.

Example

iex> Glossia.Environment.email_smtp_no_mx_lookups() true

email_smtp_password(env \\ System.get_env())

Returns the SMTP password to use.

Parameters

  • env - The environment variables to use. Defaults to System.get_env().

Returns

  • String.t() - The SMTP password.

Example

iex> Glossia.Environment.email_smtp_password() "ilovepepperpotts"

email_smtp_port(env \\ System.get_env())

Returns the SMTP port to use.

Parameters

  • env - The environment variables to use. Defaults to System.get_env().

Returns

  • integer() - The SMTP port.

Example

iex> Glossia.Environment.email_smtp_port()

email_smtp_relay(env \\ System.get_env())

Returns the SMTP relay to use.

Parameters

  • env - The environment variables to use. Defaults to System.get_env().

Returns

  • String.t() - The SMTP relay.

Example

iex> Glossia.Environment.email_smtp_relay() "smtp.avengers.com"

email_smtp_retries(env \\ System.get_env())

Returns the SMTP retries to use.

Parameters

  • env - The environment variables to use. Defaults to System.get_env().

Returns

  • integer() - The SMTP retries.

Example

iex> Glossia.Environment.email_smtp_retries()

email_smtp_ssl(env \\ System.get_env())

Returns whether to use SSL.

Parameters

  • env - The environment variables to use. Defaults to System.get_env().

Returns

  • boolean() - Whether to use SSL.

Example

iex> Glossia.Environment.email_smtp_ssl() true

email_smtp_tls(env \\ System.get_env())

Returns whether to use TLS.

Parameters

  • env - The environment variables to use. Defaults to System.get_env().

Returns

  • atom() - Whether to use TLS.

Example

iex> Glossia.Environment.email_smtp_tls() :always

email_smtp_user(env \\ System.get_env())

Returns the SMTP username to use.

Parameters

  • env - The environment variables to use. Defaults to System.get_env().

Returns

  • String.t() - The SMTP username.

Example

iex> Glossia.Environment.email_smtp_user() "tonystark"

raise_when_required_absent()