Closed skosch closed 3 years ago
Hey @skosch - awesome sauce! I'll have a look most prolly first thing tomorrow. Thanks!
@skosch not sure why but I'm seeing 14 tests failing here.
Seems that it's somewhat related to rendering and what :mimemail.encode
is expecting. Here's an excerpt showing one of those tests:
1) test should load text part of email from external file (MailmanTest)
test/mailman_test.exs:233
** (FunctionClauseError) no function clause matching in :proplists.get_value/3
The following arguments were given to :proplists.get_value/3:
# 1
"content-type-params"
# 2
%{}
# 3
[]
code: {:ok, message} = MyApp.ExternalTextMailer.deliver(email_with_external_text)
stacktrace:
(stdlib 3.13) proplists.erl:215: :proplists.get_value/3
(gen_smtp 0.15.0) /home/kamil/projects/mailman/deps/gen_smtp/src/mimemail.erl:653: :mimemail.ensure_content_headers/7
(gen_smtp 0.15.0) /home/kamil/projects/mailman/deps/gen_smtp/src/mimemail.erl:155: :mimemail.encode/2
(mailman 0.4.3) lib/mailman.ex:43: Mailman.deliver/3
test/mailman_test.exs:235: (test)
Huh, thanks so much for catching that. Somehow I didn't get these last time, but I can reproduce them now. :thinking: let me look into that
Ah, I see what happened now. My bad! I made this work based on https://github.com/gen-smtp/gen_smtp/issues/188, and when they recently released their new 0.15 I had assumed that this change was included in that ... but turns out they excluded it, as it's a breaking change.
Let's hold off on this until their 1.0 is out. Again, sorry about the noise
Good news – the folks at gen_smtp were very quick and released their v1.0 yesterday! Now this PR should work. Could you take another look?
@kamilc ping :)
Could you take a look at this one and #91, and merge and publish if it looks ok to you? Thanks!
@skosch Oh my - apologies for keeping you waiting for so long! In my defense - I've been massively swamped lately. Thanks for merging that in!
I'll push it to hex soon
Hey, no worries. I figured I've been using it in production long enough that merging would be ok. I just fixed the CI script as well; you can push to hex now. Thanks!
It's just been published @skosch - https://hex.pm/packages/mailman Happy Friday!
This fixes compatibility issues with gen_smtp 0.15, which will pave the way for allowing multiple emails to be sent via a persistent connection with the relay. This is useful when sending many emails at once.
It also fixes an encoding issue with Reply-To headers.
@kamilc if this looks ok to you, please go ahead and merge and publish to hex.pm. Thanks :)