class Ponga::Mailer

Constants

API_ENDPOINT

Attributes

api_key[R]

Public Class Methods

new(api_key) click to toggle source
# File lib/ponga/mailer.rb, line 6
def initialize(api_key)
  @api_key = api_key
end

Public Instance Methods

send(subject:, body:, to:) click to toggle source
# File lib/ponga/mailer.rb, line 10
def send(subject:, body:, to:)
  HTTParty.post(API_ENDPOINT, body: {
    message: {
      subject: subject,
      recipient: to,
      body: body
    },
    key: api_key
  })
end