class WalkSummaryMailer < MandrillMailer::TemplateMailer
  default from: 'info@wagwag.io'

  def send_walk_summary(walk_summary)

    pet = walk_summary.pet
    user = User.find(pet.user)
    subject = 'Walk Summary for ' + Date.today.to_s


    peed = 'Nope'
    pooped = 'Nope'
    if walk_summary.peed
      peed = 'Yes'
    end

    if walk_summary.pooped
      pooped = 'Yes'
    end

    mandrill_mail(
        template: 'Walk_Summary',
        to: { email: user.email, name: user.name},
        subject: subject,
        vars: {
            'PET_NAME' => pet.name,
            'PEED'   => peed,
            'POOPED'     => pooped,
            'NOTE'     => walk_summary.note,
            'IMAGE'    => walk_summary.image
        },
        important: false,
        inline_css: true,
    )
  end
end