Closed rubydev closed 6 years ago
With gem mail version 2.6.4 it is working well, with 2.7.0 no.
Yes, there is breaking change of the private API in mail
2.7.0. As far as mandrill_dm
relies on private API for retrieving header value unmodified, it should be updated accordingly.
>> require 'mail'
true
>> Mail::VERSION.version
"2.7.0"
>> m = Mail.new
#<Mail::Message:70160019869900, Multipart: false, Headers: >
>> m[:global_merge_vars] = {
'name' => 'FNAME',
'content' => 'Jamie'
}
{
"name" => "FNAME",
"content" => "Jamie"
}
>> m[:global_merge_vars].instance_variable_get(:@value)
nil # Should be initial value according to mail 2.6.4
>> m[:global_merge_vars].instance_variable_get(:@unparsed_value)
{
"name" => "FNAME",
"content" => "Jamie"
}
>> m[:global_merge_vars].value
"{\"name\"=>\"FNAME\", \"content\"=>\"Jamie\"}" # Still returns encoded value
Compare #field
method in version 2.7.0 and 2.6.4. You may notice that the raw value is no more assigned to @value
. But mandrill_dm
relies on it in the #get_value
method.
@rubydev please try version 1.3.5
. It should work with both mail 2.6.x
and 2.7.x
.
Hello,
my code looks like this:
But "global_merge_vars" are in header instead in message. So vars aren't replaced. Could you help me? Request looks like this:
Maybe I'm using it in wrong way? Could you help me?