Module: MailMCP::AttachmentStore
- Defined in:
- lib/mail_mcp/attachment_store.rb
Constant Summary collapse
- EXPIRY =
7 * 24 * 3600
Class Method Summary collapse
Class Method Details
.upload(content:, filename:, content_type:) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/mail_mcp/attachment_store.rb', line 8 def self.upload(content:, filename:, content_type:) key = "attachments/#{SecureRandom.uuid}/#{filename}" bucket = ENV.fetch("AWS_S3_BUCKET") s3.put_object( bucket: bucket, key: key, body: content, content_type: content_type ) presigner.presigned_url(:get_object, bucket: bucket, key: key, expires_in: EXPIRY) end |