Class: Campagne::CampagneCampaign

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/campagne/campagne_campaign.rb

Instance Method Summary collapse

Instance Method Details

#formated_body(token) ⇒ Object



12
13
14
15
16
17
18
# File 'app/models/campagne/campagne_campaign.rb', line 12

def formated_body(token)
  formated_body = body.gsub('||WB||', "<img src=\"#{Rails.application.config.campagne_base_url}/campagne/see/#{token}\" width=\"1\" height=\"1\" />")
  formated_body = formated_body.gsub('||UNSUB||', "#{Rails.application.config.campagne_base_url}/campagne/unsubscribe/#{token}")
  formated_body = formated_body.gsub('||LINK||', "#{Rails.application.config.campagne_base_url}/campagne/click/#{token}?link=")
  # formated_body = formated_body.gsub('||VIEW||', "#{Rails.application.config.campagne_base_url}/campagne/preview/#{token}")
  formated_body
end

#previewObject



20
21
22
# File 'app/models/campagne/campagne_campaign.rb', line 20

def preview
  formated_body('0')
end