Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show the email in the list instead of the selected #127

Merged
merged 1 commit into from
Apr 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/bamboo/plug/index.html.eex
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@
href="<%= "#{@base_path}/#{Bamboo.SentEmail.get_id(email)}" %>">
<span class="email-summary-subject truncate"><%= email.subject %></span>
<span class="email-summary-recipients truncate">
<%= Bamboo.Email.get_address(@selected_email.from) %>
to <%= Bamboo.EmailPreviewPlug.Helper.email_addresses(@selected_email) %>
<%= Bamboo.Email.get_address(email.from) %>
to <%= Bamboo.EmailPreviewPlug.Helper.email_addresses(email) %>
</span>
<span class="email-summary-body-excerpt"><%= email.text_body %></span>
</a>
Expand Down
1 change: 1 addition & 0 deletions test/lib/bamboo/plug/email_preview_plug_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ defmodule Bamboo.EmailPreviewTest do
for email <- emails do
assert Floki.raw_html(sidebar(conn)) =~ ~s(href="/sent_emails/foo/#{SentEmail.get_id(email)}")
assert Floki.text(sidebar(conn)) =~ email.subject
assert Floki.text(sidebar(conn)) =~ Bamboo.Email.get_address(email.from)
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/support/factory.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Bamboo.Factory do

def factory(:email) do
%Bamboo.Email{
from: "from@gmail.com",
from: sequence(:email, &"from-#{&1}@gmail.com"),
subject: sequence("Email subject")
}
end
Expand Down