kshnurov / mandrill_dm

A basic Mandrill delivery method for Rails.
MIT License
46 stars 45 forks source link

Readme syntax for template variables incorrect #41

Closed pivotal-give-lively closed 8 years ago

pivotal-give-lively commented 8 years ago

The ability to use Mandrill templates is excellent, but the Readme example seems to be a bit off-- specifically this bit:

template_content: [ # optional
    {
      name: 'header',
      content: 'string to replace a *|header|* in your template',
    },
    {
      name: 'content',
      content: 'string to replace a *|content|* in your template'
    }
  ]
)

The template_content key is used by editable content areas, which insert content into tags with an associated mc:edit property, while *|variable|* syntax is for merge variables, which can be specified either with the global_merge_vars key (for all recipients) or the merge_vars key (per recipient).

spovich commented 8 years ago

PR's are always welcome, especially for documentation.

danenania commented 8 years ago

Hi, I'm same user as above--posted under the wrong account. I'm happy to make a PR. Just wanted to verify first that I'm not misunderstanding anything. Looks like @genaromadrid added this functionality... any thoughts?

genaromadrid commented 8 years ago

Hey @danenania, i'm using the gem for inserting *|variable|* into mandrill templates and it works like a charm. Maybe you can use it either with mc:edit or *|variable|*.

FunkyloverOne commented 6 years ago

It seems like if you're using handlebars for dynamic content, then template_content is not working, and you should use merge_vars or global_merge_vars