Skip to content

Commit

Permalink
Revert "Add support for content_id to SendGridAdapter (beam-community…
Browse files Browse the repository at this point in the history
…#640)" (beam-community#650)

This reverts commit 49a6d5a.
  • Loading branch information
brian-penguin committed Jan 6, 2023
1 parent 49a6d5a commit 956dbc7
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions lib/bamboo/adapters/send_grid_adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -368,26 +368,17 @@ defmodule Bamboo.SendGridAdapter do

defp put_click_tracking(body, _), do: body

defp is_inline_image?(%_{content_type: "image/" <> _, content_id: cid}) when not is_nil(cid),
do: true

defp is_inline_image?(_), do: false

defp put_attachments(body, %Email{attachments: []}), do: body

defp put_attachments(body, %Email{attachments: attachments}) do
transformed =
attachments
|> Enum.reverse()
|> Enum.map(fn attachment ->
disposition = if is_inline_image?(attachment), do: "inline", else: "attachment"

%{
filename: attachment.filename,
type: attachment.content_type,
disposition: disposition,
content: Base.encode64(attachment.data),
content_id: attachment.content_id
content: Base.encode64(attachment.data)
}
end)

Expand Down

0 comments on commit 956dbc7

Please sign in to comment.