Mailboxer attachments via CarrierWave

851 views Asked by At

I'm trying to send messages with attachments, using CarrierWave. In Mailboxer gem I find that the uploader mounted here. It uses AttachmentUploader for the field :attachment

In base functionality all works good. Attached files stored in public/uploads folder.

But I need add custom functionality to AttachmentUploader (Eg. change the path to store attachments etc.).

I trying create my own attachment_uploader.rb in app/uploaders but it doesn't work.

1

There are 1 answers

0
Alex Brovikov On BEST ANSWER

I just added to initializers/mailboxer.rb

...
class AttachmentUploader < AllAttachmentUploader

end

It allow me inherit from AllAttachmentUploader to AttachmentUploader which was defined in Mailboxer.