{"repo":"ankane/ahoy_email","free":true,"listed":false,"github":"https://github.com/ankane/ahoy_email","clone":"git clone https://github.com/ankane/ahoy_email.git","description":"First-party email analytics for Rails","language":"Ruby","stars":1189,"topics":["analytics","first-party-analytics","rails"],"license":"MIT","category":"analytics","readme_excerpt":"Ahoy Email First-party email analytics for Rails Ahoy Email 4.0 was recently released - see how to upgrade :fire: For web and native app analytics, check out Ahoy :bullettrain side: To manage email subscriptions, check out Mailkick Installation Add this line to your application’s Gemfile: Getting Started There are three main features, which can be used independently: - Message history - UTM tagging - Click analytics Message History To encrypt email addresses with Lockbox, install Lockbox and Blind Index and run: To use Active Record encryption, run: If you prefer not to encrypt data, run: Then, add to mailers: Use the Ahoy::Message model to query messages: Use only and except to limit actions To store history for all mailers, create config/initializers/ahoy email.rb with: Users By default, Ahoy Email tries @user then params[:user] then User.find by(email: message.to) to find the user. You can pass a specific user with: The user association is polymorphic, so use it with any model. To get all messages sent to a user, add an association: And run: Extra Data Add extra data to messages. Create a migration like: And use: You can use a proc as well. Options Set global options Use a different model Or fully customize how messages are tracked Data Retention Delete older data with: Delete data for a specific user with: UTM Tagging Use UTM tagging to attribute visits or conversions to an email campaign. Add UTM parameters to links with: The defaults are: - utm medium - email - utm sour","default_branch":null,"files":null,"tree":[],"storefront":"/r/ankane","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ankane/ahoy_email/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}