renz45/mandrill_mailer

Empty emails

Closed this issue · 1 comments

Hi! Thanks for the great gem.
I am having troubles sending emails with template in mandrill.
I always receive empty email (but template is present in mandrill).
When I add text and html attributes to mandrill_mail method I receive email with content. But thing is I want to store template in the mandrill.

I also noticed if I enter wrong template slug it does not throw error, but sends empty email.
I checked and rechecked template name and it matches.

mandrill_mail(
      template: 'mydomain-oauth-welcome',
      from: 'hello@mydomain.com',
      from_name: 'MYDOMAIN',
      to: { email: user.email, name: user.name },
      recipient_vars: [
        { user.email => {
          'name' => user.name,
          'profile_link' => users_edit_profile_url,
          'tos_link' => tos_url
        } }
      ],
      important: true,
      inline_css: true,
      merge_language: 'handlebars'
    )

I use Rails 6 with ruby 2.6.3.

In the API logs of Mandrill I see calls to messages/send.json, but it looks like it should be messages/send-template.

Any ideas how to fix it?

My bad, was using wrong parent for mailer class