Closed spovich closed 9 years ago
@jlberglund @kshnurov if if either of you have a few minutes, I'd appreciate some :eyes: on this. There is a lot of noise in the message_spec.rb because I put things in alpha order (was making me crazy).
They use-case for this is that I want to customize links in emails for multiple recipients to include the email address of the individual who clicks the link (not waiting for webhook). merge
and merge_language
let me do that.
If you have a link in the body of your email like below and you specify merge
is true
and merge_language
is handlebars
:
<a href='http://my-server.com?rcpt_email={{EMAIL}}'>test link</a>
the {{EMAIL}} will be replaced with the specific recipient email address.
Cleanup looks good. And merging seems like a good idea. I've run into a couple of instances where it would have been helpful (along with Mandrill templates). +1
@spovich If you want to use a style guide, btw, feel free to reference it in the Wiki.
@spovich global_merge_vars
and merge_vars
should be added to make merge
really useful. I've created an issue #17
Mandrill API accepts a boolean for
merge
which indicates there is content in the email body that can be dynamically substituted. Also, mandrill supports two differentmerge_language
settings (handlesbars
ormailchimp
).This PR allows you to set the
merge
flag and themerge_language
.This PR also does a fair bit of clean up:
each_with_object
to cleanupcombine_extra_header_fields
#header
specs.Having long files with methods/lists not in alpha order was making me crazy so:
lib/mandrill_dm/message.rb
attribute methods in alpha ordermessage_spec.rb
describe blocks (for methods) in alpha orderto_json
attributes in alpha ordercombine_extra_header_fields
header list in alpha order