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.now) ⇒ Object


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

def confirm_event(receiver, eventful, message, content, _milestone, sent_at = Time.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.now) ⇒ Object


60
61
62
63
64
65
66
67
68
69
70
# File 'lib/eventful_mailer.rb', line 60

def confirm_external_release_event(receiver, eventful, message, content, _milestone, sent_at = Time.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_sample_event(receiver, eventful, message, content, _milestone, sent_at = Time.now) ⇒ Object


26
27
28
29
30
31
32
33
34
35
36
# File 'lib/eventful_mailer.rb', line 26

def confirm_sample_event(receiver, eventful, message, content, _milestone, sent_at = Time.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

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


50
51
52
53
54
55
56
57
58
# File 'lib/eventful_mailer.rb', line 50

def fail_attempt(receiver, request, sent_at = Time.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.now) ⇒ Object


38
39
40
41
42
43
44
45
46
47
48
# File 'lib/eventful_mailer.rb', line 38

def notify_request_fail(receiver, item, request, message, sent_at = Time.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.now) ⇒ Object


14
15
16
17
18
19
20
21
22
23
24
# File 'lib/eventful_mailer.rb', line 14

def update_event(receiver, study, title, content, sent_at = Time.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