Guillaume Occuly

Joined

2,020 Experience
20 Lessons Completed
0 Questions Solved

Activity

Can we use a PORO class to deliver ?
This is what I did

app/models/new_email.rb

class NewEmail
attr_reader :params

def initialize(params)
@params = params.permit(:to, :subject, :body)
end
end

app/controllers/emails_controller.rb

NewEmailNotification.with(email: NewEmail.new(params)).deliver_later(current_user)

I received an error: Unsupported argument type: NewEmail

Why settings is a text format and preferences is a json format ?