Class: AuctionFunCore::Services::Mail::AuctionContext::PostAuction::WinnerMailer

Inherits:
Object
  • Object
show all
Includes:
IdleMailer::Mailer, IdleMailer::TemplateManager
Defined in:
lib/auction_fun_core/services/mail/auction_context/post_auction/winner_mailer.rb

Overview

Service class responsible for sending emails to auction winners.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auction, winner, statistics) ⇒ WinnerMailer

Initializes a new WinnerMailer instance.

Parameters:

  • auction (ROM::Struct::Auction)

    The auction object

  • winner (ROM::Struct::User)

    The winner object

  • statistics (OpenStruct)

    Statistics object



18
19
20
21
22
23
24
# File 'lib/auction_fun_core/services/mail/auction_context/post_auction/winner_mailer.rb', line 18

def initialize(auction, winner, statistics)
  @auction = auction
  @winner = winner
  @statistics = statistics
  mail.to = winner.email
  mail.subject = I18n.t("mail.auction_context.post_auction.winner_mailer.subject", title: @auction.title)
end

Class Method Details

.template_nameString

Returns the template name for the WinnerMailer.

Returns:

  • (String)

    The template name.



29
30
31
# File 'lib/auction_fun_core/services/mail/auction_context/post_auction/winner_mailer.rb', line 29

def self.template_name
  IdleMailer.config.templates.join("auction_context/post_auction/winner")
end