diff --git a/README.md b/README.md index 2329e2b..bf05787 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,9 @@ LetterOpener.configure do |config| # Default value is `:default` that renders styled message with showing useful metadata. config.message_template = :light + # For debugging you can render the raw message source using the `:raw` template. + # config.message_template = :raw + # To change default file URI scheme you can provide `file_uri_scheme` config. # It might be useful when you use WSL (Windows Subsystem for Linux) and default # scheme doesn't work for you. diff --git a/lib/letter_opener/templates/raw.html.erb b/lib/letter_opener/templates/raw.html.erb new file mode 100644 index 0000000..91e15e1 --- /dev/null +++ b/lib/letter_opener/templates/raw.html.erb @@ -0,0 +1,119 @@ + + + + <% if mail.subject %> + <%= h mail.subject %> + <% end %> + + + + +
+
+
+
From:
+
<%= h from %>
+ + <% unless sender.empty? %> +
Sender:
+
<%= h sender %>
+ <% end %> + + <% unless reply_to.empty? %> +
Reply-To:
+
<%= h reply_to %>
+ <% end %> + + <% if mail.subject %> +
Subject:
+
<%= h mail.subject %>
+ <% end %> + +
Date:
+
<%= Time.now.strftime("%b %e, %Y %I:%M:%S %p %Z") %>
+ + <% unless to.empty? %> +
To:
+
<%= h to %>
+ <% end %> + + <% unless cc.empty? %> +
CC:
+
<%= h cc %>
+ <% end %> + + <% unless bcc.empty? %> +
BCC:
+
<%= h bcc %>
+ <% end %> + + <% if @attachments.any? %> +
Attachments:
+
+ <% @attachments.each do |filename, path| %> + <%= filename %>  + <% end %> +
+ <% end %> +
+
+ +
+        <%= h(mail.to_s) %>
+      
+
+ +