Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29762

How to add a design template to an email?

$
0
0

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()?


Viewing all articles
Browse latest Browse all 29762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>