Class: AlchemyCrm::MailingsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/alchemy_crm/mailings_controller.rb

Instance Method Summary collapse

Methods included from I18nHelpers

#alchemy_crm_t, #i18n_t, included, #translate_model_attribute

Instance Method Details

#showObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/alchemy_crm/mailings_controller.rb', line 4

def show
  @mailing = Mailing.find_by_sha1(params[:m])
  if @mailing.nil? && !params[:id].blank?
    @mailing = Mailing.find(params[:id])
  end
  @page = @mailing.page
  if params[:r].present?
    @recipient = @mailing.recipients.find_by_sha1(params[:r])
    @contact = @recipient.contact || Contact.new_from_recipient(@recipient)
  else
    @contact = Contact.fake
    @recipient = Recipient.new_from_contact(@contact)
  end
end