28 lines
506 B
Ruby
28 lines
506 B
Ruby
require "mail"
|
|
|
|
class ContactMailer
|
|
def initialize(params)
|
|
@params = params
|
|
end
|
|
|
|
def build
|
|
email = @params["email"].strip
|
|
name = @params["name"].strip
|
|
subject = @params["subject"].strip
|
|
message = @params["message"]
|
|
|
|
Mail.new do
|
|
from "noreply@netig.net"
|
|
to "contact@netig.net"
|
|
reply_to email
|
|
content_type "text/plain; charset=UTF-8"
|
|
subject subject
|
|
body "Nom : #{name}\n\n#{message}"
|
|
end
|
|
end
|
|
|
|
def deliver
|
|
build.deliver
|
|
end
|
|
end
|