Class: FeedbacksMailbox
- Inherits:
-
ApplicationMailbox
- Object
- ActionMailbox::Base
- ApplicationMailbox
- FeedbacksMailbox
- Defined in:
- app/mailboxes/feedbacks_mailbox.rb
Overview
ActionMailbox: feedbacks.
Placeholder mailbox for feedback emails; processing is not yet implemented.
Constant Summary collapse
- RECIPIENT_FORMAT =
Recipient format.
/feedback-(.+)@example.com/i
Constants inherited from ApplicationMailbox
ApplicationMailbox::DIRECT_FILE_EXTENSIONS, ApplicationMailbox::FETCHABLE_MIME_TYPES, ApplicationMailbox::FETCH_MAX_SIZE, ApplicationMailbox::GDRIVE_FILE_RE, ApplicationMailbox::GDRIVE_OPEN_RE, ApplicationMailbox::MAX_FILENAME_LENGTH
Instance Method Summary collapse
-
#process ⇒ void
Processes the inbound feedback email (currently a no-op).
Methods inherited from ApplicationMailbox
#attempt_url_download, #collect_fetchable_urls, #create_activity, #create_communication, #fetch_linked_files, #find_sender_party, #get_resource_id, #inline_or_attachment_part?, #process_attachments, #process_content, #replace_cid_references, #sanitize_attachment_filename
Instance Method Details
#process ⇒ void
This method returns an undefined value.
Processes the inbound feedback email (currently a no-op).
13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/mailboxes/feedbacks_mailbox.rb', line 13 def process # Creating the feedback # mail.decoded returns the email body if mail is not multipart # else we'll use mail.parts[0].body.decoded # and in our case that is feedback # if mail.parts.present? # Feedback.create user_id: @user.id, product_id: product_id, content: mail.parts[0].body.decoded # else # Feedback.create user_id: @user.id, product_id: product_id, content: mail.decoded # end end |