Sha256: 7ee8f9787bd7b345645712a1e99dc35318cf086873e2f3ee6fb96c177ac7f938

Contents?: true

Size: 744 Bytes

Versions: 39

Compression:

Stored size: 744 Bytes

Contents

class EmailPagePortlet < Portlet
  
  def render
    pmap = flash[instance_name] || params
    @email_message = EmailMessage.new pmap[:email_message]
    @email_message.errors.add_from_hash flash["#{instance_name}_errors"]
    @email_page_portlet_url = pmap[:email_page_portlet_url] || request.request_uri
  end
  
  #----- Handlers --------------------------------------------------------------
  def deliver
    message = EmailMessage.new(params[:email_message])
    message.subject = self.subject
    message.body = "#{params[:email_page_portlet_url]}\n\n#{message.body}"    
    if message.save
      url_for_success
    else
      store_params_in_flash
      store_errors_in_flash(message.errors)
      url_for_failure
    end
  end
  
end

Version data entries

39 entries across 39 versions & 10 rubygems

Version Path
SFEley-browsercms-3.0.2 app/portlets/email_page_portlet.rb
buzzware-browsercms-3.0.2 app/portlets/email_page_portlet.rb
coredumplings-browsercms-3.0.0 app/portlets/email_page_portlet.rb
we5-browsercms-3.0.1.1 app/portlets/email_page_portlet.rb
webficient-browsercms-3.0.1 app/portlets/email_page_portlet.rb
webficient-browsercms-3.0.2 app/portlets/email_page_portlet.rb
webficient-browsercms-3.0.3 app/portlets/email_page_portlet.rb
webficient-browsercms-3.0.4 app/portlets/email_page_portlet.rb
browsercms-3.3.4 app/portlets/email_page_portlet.rb
browsercms-3.3.3 app/portlets/email_page_portlet.rb
browsercms-3.1.5 app/portlets/email_page_portlet.rb
browsercms-3.1.4 app/portlets/email_page_portlet.rb
browsercms-3.3.2 app/portlets/email_page_portlet.rb
browsercms-3.3.1 app/portlets/email_page_portlet.rb
browsercms-3.3.0 app/portlets/email_page_portlet.rb
browsercms-3.1.3 app/portlets/email_page_portlet.rb
browsercms-3.3.0.beta app/portlets/email_page_portlet.rb
bf4-browsercms-3.1.0 app/portlets/email_page_portlet.rb
drujensen-browsercms-3.2.0 app/portlets/email_page_portlet.rb
browsercmsi-3.1.2 app/portlets/email_page_portlet.rb