add ability to edit html email

This commit is contained in:
Alex Turchyn
2026-07-03 02:14:55 +03:00
committed by Pete Matsyburka
parent bdf5e58929
commit bba5626dea
14 changed files with 814 additions and 88 deletions
+5
View File
@@ -8,9 +8,14 @@ module EmailMessages
ASSET_REGEXP = Regexp.union(STYLE_REGEXP, BASE64_REGEXP)
ASSET_PREFIX = '[[asset:'
PLACEHOLDER_REGEXP = /\[\[asset:(\h{40})\]\]/
HTML_MIME_TYPES = ['text/html', 'application/xhtml+xml'].freeze
module_function
def html_body?(content)
content.present? && HTML_MIME_TYPES.include?(Marcel::MimeType.for(content.dup))
end
def find_or_create_for_account_user(account, user, subject, body)
subject = I18n.t(:you_are_invited_to_sign_a_document) if subject.blank?