Community Blog Post: SendGrid Metadata and Rails


Posted on

Logo for The Pug Automatic blogOver on his blog The Pug Automatic, Henrik Nyh has published a great tutorial on using categories and unique arguments to add metadata to your messages in Rails, which you can then see data in the email activity log or on in event API posts.

Henrik’s example adds the following metadata:

  • A category with the name of the mailer, e.g. “MyMailer”
  • A category with the mailer and action, e.g. “MyMailer#hello”
  • A unique argument with the Rails environment, e.g. “production”
  • A unique argument with the arguments passed into the mailer as a hash from argument name to value, like “{:foo_id=>123, :bar_id=>456}”

Thanks for sharing your experience, Henrik!

Tags: , , , ,


As a Developer Evangelist for SendGrid, Brandon's focus is on empowering developers to build things, gathering feedback for new features and improvements, and fostering a cooperative developer community for anything that needs email integration.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>