# frozen_string_literal: true

require 'mail'

class ThankYouMailer
  class << self
    def send_email(recipient, first_name)
      Mail.deliver do
        to recipient
        from 'info@survivalinternational.org'
        subject 'Thank you for your donation'
        body "Hello #{first_name}"
      end
    end
  end
end

# frozen_string_literal: true

require 'mail'

class ThankYouMailer
  def self.send_email(recipient, first_name)
    Mail.deliver do
      to recipient
      from 'info@survivalinternational.org'
      subject 'Thank you for your donation'
      body "Thank you for your donation #{first_name}"
    end
  end
end

Make the class method syntax more explicit and readable
Make the class method syntax more explicit and readable

We only have one class method and there is a lot of indentation
making the code difficult to scan. Using the class << self
syntax is a premature optimization in this case.
