mirror of
https://github.com/docusealco/docuseal
synced 2026-11-06 23:12:33 -05:00
extract email assets
This commit is contained in:
1 parent
065dcf6f9f
commit
6ed5b5d35d
8 files changed
+127
-6
No files matched your search
@@ -33,6 +33,15 @@ class EmailMessage < ApplicationRecord
|
||||
|
||||
before_validation :set_sha1, on: :create
|
||||
|
||||
def normalized_body
|
||||
@normalized_body ||=
|
||||
if body&.include?(EmailMessages::ASSET_PREFIX)
|
||||
EmailMessages.rebuild_body_with_assets(account_id, body)
|
||||
else
|
||||
body
|
||||
end
|
||||
end
|
||||
|
||||
def set_sha1
|
||||
self.sha1 = Digest::SHA1.hexdigest({ subject:, body: }.to_json)
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user