Class: Effective::EventsMailer

Inherits:
Object
  • Object
show all
Includes:
EffectiveEmailTemplatesMailer, EffectiveMailer
Defined in:
app/mailers/effective/events_mailer.rb

Instance Method Summary collapse

Instance Method Details

#event_registrant_confirmation(resource, opts = {}) ⇒ Object

Sent manually by an admin to one registrant



38
39
40
41
42
43
44
45
46
47
48
49
# File 'app/mailers/effective/events_mailer.rb', line 38

def event_registrant_confirmation(resource, opts = {})
  raise('expected an event registrant') unless resource.kind_of?(Effective::EventRegistrant)

  @event_registrant = resource
  @event = resource.event
  @event_registration = resource.event_registration # Optional

  subject = subject_for(__method__, "Confirmation - #{@event}", resource, opts)
  headers = headers_for(resource, opts)

  mail(to: resource.email, cc: mailer_admin, subject: subject, **headers)
end

#event_registrant_purchased(resource, opts = {}) ⇒ Object

For the notifications. No longer used.



11
12
13
14
15
16
# File 'app/mailers/effective/events_mailer.rb', line 11

def event_registrant_purchased(resource, opts = {})
  raise('expected an Effective::EventRegistrant') unless resource.kind_of?(Effective::EventRegistrant)

  @assigns = assigns_for(resource)
  mail(to: resource.email, **headers_for(resource, opts))
end

#event_registration_confirmation(resource, opts = {}) ⇒ Object

Sent on registration purchase Sent on delayed payment date registration submitted Sent on delayed payment date registration update Sent on update blank registrants



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/mailers/effective/events_mailer.rb', line 22

def event_registration_confirmation(resource, opts = {})
  raise('expected an event registration') unless resource.class.try(:effective_events_event_registration?)

  @event_registration = resource
  @event = resource.event

  @order = @event_registration.submit_order
  raise('expected an event registration submit_order') unless @order.present?

  subject = subject_for(__method__, "Confirmation - #{@event}", resource, opts)
  headers = headers_for(resource, opts)

  mail(to: resource.owner.email, cc: mailer_admin, subject: subject, **headers)
end