README.md in ahoy_email-2.3.1 vs README.md in ahoy_email-2.4.0

- old
+ new

@@ -31,11 +31,11 @@ ```sh rails generate ahoy:messages --encryption=lockbox rails db:migrate ``` -To use Active Record encryption (Rails 7+, experimental), run: +To use Active Record encryption, run: ```sh rails generate ahoy:messages --encryption=activerecord rails db:migrate ``` @@ -104,11 +104,11 @@ ### Extra Data Add extra data to messages. Create a migration like: ```ruby -class AddCouponIdToAhoyMessages < ActiveRecord::Migration[7.2] +class AddCouponIdToAhoyMessages < ActiveRecord::Migration[8.0] def change add_column :ahoy_messages, :coupon_id, :integer end end ``` @@ -320,9 +320,19 @@ Get stats for a campaign ```ruby AhoyEmail.stats("my-campaign") +``` + +## HTML Parsing + +By default, Nokogiri’s default HTML parser is used to rewrite links for UTM tagging and click analytics. This currently uses HTML4, which [only allows inline elements inside links](https://github.com/sparklemotion/nokogiri/issues/1876#issuecomment-468276937). + +To use HTML5 parsing, create `config/initializers/ahoy_email.rb` with: + +```ruby +AhoyEmail.default_options[:html5] = true ``` ## History View the [changelog](https://github.com/ankane/ahoy_email/blob/master/CHANGELOG.md)