Skip to content

Commit 8dc696a

Browse files
committed
temporarily display unencrypted email addresses while debugging bounce list #33
1 parent 4d00d2c commit 8dc696a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

lib/app/ctx.ex

+6-4
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,24 @@ defmodule App.Ctx do
2929
def list_sent_with_status do
3030
query = """
3131
SELECT s.id, s.message_id, s.updated_at, s.template,
32-
st.text as status, s.person_id
32+
st.text as status, s.person_id, p.email
3333
FROM sent s
3434
JOIN status as st on s.status_id = st.id
35-
ORDER by s.updated_at DESC
35+
JOIN people as p on s.person_id = p.id
36+
ORDER BY s.updated_at DESC
3637
"""
3738
{:ok, result} = Repo.query(query)
3839

3940
# create List of Maps from the result.rows:
40-
Enum.map(result.rows, fn([id, mid, iat, t, s, pid]) ->
41+
Enum.map(result.rows, fn([id, mid, iat, t, s, pid, e]) ->
4142
%{
4243
id: id,
4344
message_id: mid,
4445
inserted_at: NaiveDateTime.truncate(iat, :second),
4546
template: t,
4647
status: s,
47-
person_id: pid
48+
person_id: pid,
49+
email: Fields.AES.decrypt(e)
4850
}
4951
end)
5052
end

lib/app_web/templates/page/dashboard.html.leex

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
<th>Status</th>
88
<th>Time</th>
99
<th>person_id</th>
10+
<th>email</th>
11+
1012
</tr>
1113
</thead>
1214
<tbody>
@@ -19,6 +21,7 @@
1921
<td class="<%= sent.status %>"><%= sent.status %></td>
2022
<td><%= sent.inserted_at %></td>
2123
<td><%= sent.person_id %></td>
24+
<td><%= sent.email %></td>
2225
</tr>
2326
<% end %>
2427
</tbody>

0 commit comments

Comments
 (0)