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