Module: Practical::Test::Helpers::Postmark

Defined in:
app/lib/practical/test/helpers/postmark.rb

Instance Method Summary collapse

Instance Method Details

#extract_template_model(mail:) ⇒ Object



4
5
6
7
8
9
10
# File 'app/lib/practical/test/helpers/postmark.rb', line 4

def extract_template_model(mail:)
  scanner = StringScanner.new(mail.body.encoded)
  scanner.skip_until(/Model:\r\n/)

  result = scanner.scan_until(/^Use the #prerender/)
  return JSON.parse(result.gsub("Use the #prerender", ''))
end