Module: Mailtrap::Mail
- Defined in:
- lib/mailtrap/mail.rb,
lib/mailtrap/mail/base.rb,
lib/mailtrap/mail/from_template.rb
Defined Under Namespace
Classes: Base, FromTemplate
Class Method Summary collapse
Class Method Details
.from_message(message) ⇒ Mailtrap::Mail::Base
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/mailtrap/mail.rb', line 14 def () # rubocop:disable Metrics/AbcSize, Metrics/MethodLength Mailtrap::Mail::Base.new( from: prepare_addresses(address_list(['from'])&.addresses).first, to: prepare_addresses(address_list(['to'])&.addresses), cc: prepare_addresses(address_list(['cc'])&.addresses), bcc: prepare_addresses(address_list(['bcc'])&.addresses), subject: .subject, text: prepare_text_part(), html: prepare_html_part(), headers: prepare_headers(), attachments: (.), category: ['category']&.unparsed_value, custom_variables: ['custom_variables']&.unparsed_value ) end |