instance method
create_and_extract_message_id!
Ruby on Rails 8.0.4
Since v6.0.6Signature
create_and_extract_message_id!(source, **options)
Create a new InboundEmail from the raw source of the email, which is uploaded as an Active Storage attachment called raw_email. Before the upload, extract the Message-ID from the source and set it as an attribute on the new InboundEmail.
Parameters
-
sourcereq -
optionskeyrest
Source
# File actionmailbox/app/models/action_mailbox/inbound_email/message_id.rb, line 16
def create_and_extract_message_id!(source, **options)
message_checksum = OpenSSL::Digest::SHA1.hexdigest(source)
message_id = extract_message_id(source) || generate_missing_message_id(message_checksum)
create! raw_email: create_and_upload_raw_email!(source),
message_id: message_id, message_checksum: message_checksum, **options
rescue ActiveRecord::RecordNotUnique
nil
end
Defined in actionmailbox/app/models/action_mailbox/inbound_email/message_id.rb line 16
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionMailbox::InboundEmail::MessageId