Module: C80Contest::MailerHelper

Included in:
BidMailer
Defined in:
app/helpers/c80_contest/mailer_helper.rb

Instance Method Summary collapse

Instance Method Details

#format_message(bid) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/helpers/c80_contest/mailer_helper.rb', line 3

def format_message(bid)

  # noinspection RubyResolve
  m = Setting.first.message_text

  tmp = m.gsub!('{title}',bid.title)
  m = tmp unless tmp.nil?

  tmp = m.gsub!('{phone}',bid.phone)
  m = tmp unless tmp.nil?

  tmp = m.gsub!('{bid_id}',bid.id.to_s)
  m = tmp unless tmp.nil?

  tmp = m.gsub!('{photo_url}',bid.photo.url.to_s)
  m = tmp unless tmp.nil?
  m
end