Class: TicketMailer
- Inherits:
-
ApplicationMailer
- Object
- ActionMailer::Base
- ApplicationMailer
- TicketMailer
- Defined in:
- app/mailers/ticket_mailer.rb
Overview
This class send collect the tickets notification
Instance Method Summary collapse
-
#confirm(ticket) ⇒ Object
Send confirmation email for a ticket.
-
#deleted(ticket) ⇒ Object
Send notify email on destroy ticket.
-
#reminder(happening, user) ⇒ Object
Send reminder for an event happeningf.
Instance Method Details
#confirm(ticket) ⇒ Object
Send confirmation email for a ticket
5 6 7 8 9 |
# File 'app/mailers/ticket_mailer.rb', line 5 def confirm(ticket) @ticket = ticket @happening = @ticket.happening mail to: @ticket.user.email, subject: subject(action: "confirm", date: @happening.start_at) end |
#deleted(ticket) ⇒ Object
Send notify email on destroy ticket
13 14 15 16 17 18 |
# File 'app/mailers/ticket_mailer.rb', line 13 def deleted(ticket) @ticket = ticket @happening = @ticket.happening @tickets = Ticket.where(user: ticket.user, happening: ticket.happening) mail to: @ticket.user.email, subject: subject(action: "deleted", date: @happening.start_at) end |
#reminder(happening, user) ⇒ Object
Send reminder for an event happeningf
23 24 25 26 27 28 |
# File 'app/mailers/ticket_mailer.rb', line 23 def reminder(happening, user) @happening = happening @user = user @counter = @happening.tickets.with_user(@user).count mail to: @user.email, subject: subject(action: "reminder", date: @happening.start_at) if @counter > 0 end |