I have the below code in mailer:
#contact_mailer.rb
def sendCode(message,email)
all_body = "message: #{message} "
mail(to: email, body: all_body,subject: 'Sample Email')
end
And in controller I call this function
ContactMailer.sendCode(rand_num, params[:email]).deliver
This sends the message, but without any design.
I have created a file sendCode.html.erb
inside contact mailer with my design to the email.
How can I assign that email design to sendCode()
?