I'm using the SendGrid API and I am trying to find a cleaner way to generate HTML content to send as an email.
I would like to try and use some of my current mailer html template files and pass a database object to them to receive the response, but I am not sure how that is done or if it can be. Here is essentially what I am wanting to do.
@user = User.find(1)
html_content = render "mailers/my_mailer", user: @user
@user.send_html_content(html_content)
Maybe there is a better way of doing this but I'm not sure. Any tips would be appreciated!
Thanks in advance.