Class: Europeana::FeedbackButton::FeedbackMailer

Inherits:
ApplicationMailer
  • Object
show all
Defined in:
app/mailers/europeana/feedback_button/feedback_mailer.rb

Instance Method Summary collapse

Instance Method Details

#post(text:, type:, page:, email: nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/mailers/europeana/feedback_button/feedback_mailer.rb', line 6

def post(text:, type:, page:, email: nil)
  fail NoRecipientError unless Europeana::FeedbackButton.enabled?

  @text = text
  @type = type
  @page = page
  @email = email

  mail_options = {
    to: Europeana::FeedbackButton.mail_to,
    subject: text.truncate(100, separator: ' ')
  }
  mail(mail_options)
end