Class: SendGridActionMailerAdapter::Converters::Attachments
- Inherits:
-
Object
- Object
- SendGridActionMailerAdapter::Converters::Attachments
- Defined in:
- lib/sendgrid_actionmailer_adapter/converters/attachments.rb
Instance Method Summary collapse
Instance Method Details
#assign_attributes(sendgrid_mail, value) ⇒ Object
26 27 28 29 30 |
# File 'lib/sendgrid_actionmailer_adapter/converters/attachments.rb', line 26 def assign_attributes(sendgrid_mail, value) Array(value).each do || sendgrid_mail.() end end |
#convert(mail) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/sendgrid_actionmailer_adapter/converters/attachments.rb', line 13 def convert(mail) mail..map do || ::SendGrid::Attachment.new.tap do || .type = .mime_type .content = ::Base64.strict_encode64(.body.raw_source) .filename = ::Mail::Encodings.decode_encode( .content_type_parameters['filename'], :decode ) .content_id = .cid end end end |
#validate(_mail) ⇒ Object
10 11 |
# File 'lib/sendgrid_actionmailer_adapter/converters/attachments.rb', line 10 def validate(_mail) end |