class Notifier < ActionMailer::Base
  default from: "Mozo <service@mozo.bar>"
  layout 'mail'

  def contact_form(contact_form_id)
    @contact_form = Cmtool::ContactForm.find(contact_form_id)
    I18n.locale = :en
    mail to: "bterkuile+mozo-contact-form@gmail.com", subject: "[CONTACTFORM] new entry"
  end

  def user_feedback(feedback_id)
    @user_feedback = UserFeedback.find(feedback_id)
    I18n.locale = :en
    mail to: "bterkuile+mozo-user-feedback@gmail.com", subject: "[MOZO][USER-FEEDBACK] New user feedback"
  end

  def new_supplier(supplier_id, employee_id)
    return unless @supplier = Supplier.find(supplier_id)
    @employee = Employee.find(employee_id)
    @employee.enrich_with_settings @supplier.settings_for(@employee)
    mail to: "bterkuile+mozo-new-supplier@gmail.com", subject: "[MOZO][NEW-SUPPLIER] New supplier registration"
  end
end
