title: Render HTML string in email body with ActionMailer class in Ruby
body: <p>I'm trying to send mail in ROR using ActionMailer class.</p>
  
  <p>I have created a mail object like : </p>
  
  <pre><code>mail(to: 'xyz@gmail.com', subject: "some subject text", body: template)
  </code></pre>
  
  <p><strong>Here template is a string which contains the HTML to be rendered in the mail body.</strong></p>
  
  <p>When I'm trying the above declaration, the HTML string is getting displayed as it is in Gmail or any other client rather then getting rendered.</p>
  
  <p>I'm aware of the fact that I can make a separate ERB file for view and 
  mailer views are located in the app/views/name_of_mailer_class
  directory. </p>
  
  <p>But I want to the render the HTML string I'm generating from another source inline without storing it in a file.</p>
  
  <p>I have also tried this method I found in the link below, but it is producing the same result. <a href="http://carols10cents.github.io/versioned_rails_guides/v3.2.2/action_mailer_basics.html" rel="nofollow noreferrer">http://carols10cents.github.io/versioned_rails_guides/v3.2.2/action_mailer_basics.html</a></p>
  
  <pre><code>mail(:to =&gt; user.email,
           :subject =&gt; "Welcome to My Awesome Site") do |format|
        format.html { render 'another_template' }
        format.text { render :text =&gt; 'Render text' }
      end 
  </code></pre>