Class: EventfulMailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/eventful_mailer.rb

Instance Method Summary collapse

Instance Method Details

#confirm_event(receiver, eventful, message, content, _milestone, sent_at = Time.zone.now) ⇒ Object

rubocop:todo Metrics/ParameterLists



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/eventful_mailer.rb', line 4

def confirm_event(receiver, eventful, message, content, _milestone, sent_at = Time.zone.now)
  @eventful = eventful
  @message = message
  @content = content
  mail(
    from: configatron.sequencescape_email.to_s,
    subject: "#{configatron.mail_prefix} #{eventful.class} #{eventful.id}: #{message}",
    bcc: receiver,
    sent_on: sent_at
  )
end

#confirm_external_release_event(receiver, eventful, message, content, _milestone, sent_at = Time.zone.now) ⇒ Object

rubocop:todo Metrics/ParameterLists



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/eventful_mailer.rb', line 67

def confirm_external_release_event(receiver, eventful, message, content, _milestone, sent_at = Time.zone.now)
  # rubocop:enable Metrics/ParameterLists
  @eventful = eventful
  @message = message
  @content = content
  mail(
    from: configatron.sequencescape_email.to_s,
    subject: "#{configatron.mail_prefix} #{eventful.class} #{eventful.id}: #{message}",
    bcc: receiver,
    sent_on: sent_at
  )
end

#confirm_sample_event(receiver, eventful, message, content, _milestone, sent_at = Time.zone.now) ⇒ Object

rubocop:todo Metrics/ParameterLists



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/eventful_mailer.rb', line 31

def confirm_sample_event(receiver, eventful, message, content, _milestone, sent_at = Time.zone.now)
  # rubocop:enable Metrics/ParameterLists
  @eventful = eventful
  @message = message
  @content = content
  mail(
    from: configatron.sequencescape_email.to_s,
    subject: "#{configatron.mail_prefix} #{eventful.class} #{eventful.id}: #{message}",
    bcc: receiver,
    sent_on: sent_at
  )
end

#fail_attempt(receiver, request, sent_at = Time.zone.now) ⇒ Object



56
57
58
59
60
61
62
63
64
# File 'lib/eventful_mailer.rb', line 56

def fail_attempt(receiver, request, sent_at = Time.zone.now)
  @request = request
  mail(
    from: configatron.sequencescape_email.to_s,
    subject: "#{configatron.mail_prefix} Attempt fail for #{request.id}",
    bcc: receiver,
    sent_on: sent_at
  )
end

#notify_request_fail(receiver, item, request, message, sent_at = Time.zone.now) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/eventful_mailer.rb', line 44

def notify_request_fail(receiver, item, request, message, sent_at = Time.zone.now)
  @item = item
  @request = request
  @message = message
  mail(
    from: configatron.sequencescape_email.to_s,
    subject: "#{configatron.mail_prefix} Request failure for item #{item.id}",
    bcc: receiver,
    sent_on: sent_at
  )
end

#update_event(receiver, study, title, content, sent_at = Time.zone.now) ⇒ Object

rubocop:enable Metrics/ParameterLists



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/eventful_mailer.rb', line 18

def update_event(receiver, study, title, content, sent_at = Time.zone.now)
  @study = study
  @message = title
  @content = content
  mail(
    from: configatron.sequencescape_email.to_s,
    subject: "#{configatron.mail_prefix}  Study #{study.id}: #{title}",
    bcc: receiver,
    sent_on: sent_at
  )
end