Action Mailer

rails generate mailer ReservationMailer
#rails 4.2+ introduced .deliver_now
ReservationMailer.reserved("[email protected]", "someone").deliver_now

class ReservationMailer < ActionMailer::Base
  default from: "[email protected]"

  def reserved(email, name)
    mail( to: email,
          subject: "Reservation confirmation",
          body: "#{name}",
          content_type: "text/html")
  end
end

Reference

results matching ""

    No results matching ""