View Source Glific.Communications.Mailer (Glific v5.1.6)

This module provides a simple interface for sending emails.

Link to this section Summary

Functions

All notification differ only in subject and content, Lets write a common function and centralize notification code

Support CC for all the emails

Sends an email to the given recipient.

Default sender for all the emails

Link to this section Functions

Link to this function

common_send(org, subject, body, send_to \\ nil)

View Source
@spec common_send(
  Glific.Partners.Organization.t(),
  String.t(),
  String.t(),
  tuple() | nil
) ::
  Swoosh.Email.t()

All notification differ only in subject and content, Lets write a common function and centralize notification code

Link to this function

deliver(email, config \\ [])

View Source
@spec deliver(Swoosh.Email.t(), Keyword.t()) :: {:ok, term()} | {:error, term()}
Link to this function

deliver!(email, config \\ [])

View Source
@spec deliver!(Swoosh.Email.t(), Keyword.t()) :: term() | no_return()
Link to this function

deliver_many(emails, config \\ [])

View Source
@spec deliver_many(
  [
    %Swoosh.Email{
      assigns: term(),
      attachments: term(),
      bcc: term(),
      cc: term(),
      from: term(),
      headers: term(),
      html_body: term(),
      private: term(),
      provider_options: term(),
      reply_to: term(),
      subject: term(),
      text_body: term(),
      to: term()
    }
  ],
  Keyword.t()
) :: {:ok, term()} | {:error, term()}
@spec glific_support() :: tuple()

Support CC for all the emails

@spec send(Swoosh.Email.t(), map()) :: {:ok, term()} | {:error, term()}

Sends an email to the given recipient.

@spec sender() :: tuple()

Default sender for all the emails