Note that there are some explanatory texts on larger screens.

plurals
  1. PORails mailer and mailer views in subfolder not working
    primarykey
    data
    text
    <p>I have a mailer that I can see in my log is getting sent, but the email body does not contain anything from the mailer view.</p> <p>It's due to the fact that I've put things in subfolders and i've tried using <code>:template_path</code> in my <code>mail</code> function but to no avail.</p> <p>app/mailers/marketing/marketing_mailer.rb</p> <pre><code>class Marketing::MarketingMailer &lt; ActionMailer::Base require 'mail' address = Mail::Address.new "test@example.com" # ex: "john@example.com" address.display_name = "Text" # ex: "John Doe" # Set the From or Reply-To header to the following: address.format # returns "John Doe &lt;john@example.com&gt;" default from: address # Sends an email when someone fills out the contact form def contact(name, email, message) @name = name @email = email @message = message mail(:subject =&gt; "Test", :to =&gt; 'test@example.com', :reply_to =&gt; @email) # &lt;== I've tried using :template_path =&gt; 'marketing', 'marketing/marketing_mailer', etc, but none worked. end end </code></pre> <p>/app/views/marketing/marketing_mailer/contact.html.erb</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;Name: &lt;%= @name %&gt;&lt;/p&gt; &lt;p&gt;Email: &lt;%= @email %&gt;&lt;/p&gt; &lt;p&gt;Message: &lt;%= @message %&gt;&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I noticed that devise has mailer views inside /views/devise/mailers/... so I know it's possible, but i'm not sure how.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload