3
votes

I want to setup amp-email in ruby-on-rails. So I can get benefit of dynamic email content.

I have found rails_amp gem and using this I have made changes in mime_types.rb file

Mime::Type.register_alias 'text/html', RailsAmp.default_format

and also made changes in rails_amp.yml file. which is shown below.

targets:
  mailers:

and setup a mail with view of amp.erb. But it isn't sending dynamic email and make it html forcefully and mail doesn't have dynamic email symbol.

Can any one please guide me how to setup mailer to send dynamic emails?

2

2 Answers

1
votes

It seems rails_amp was last updated almost 2 years ago, before AMP for Email existed, so I believe it doesn't support this format.

For Gmail, you also need to whitelist your sender email following the steps outlined in Test dynamic email.

1
votes

A little late, but posting here for anyone who comes to this link in future.

I couldn't find a way to test AMP Emails in development environment, so I had to deploy my application live and has domain setup. Then I added TXT records to DNS so that emails can pass Domain Keys Identified Mail (DKIM) and Sender Policy Framework (SPF) authentication.

To test AMP Emails in Gmail, I enabled developer settings and added email from my domain to whitelist it.

Then I configured ActionMailer to send amp, html and text format emails. I have created a blog post here to explain, how AMP Emails can be implemented in A Ruby on Rails Application.