Mange / roadie-rails

Making HTML emails comfortable for the Rails rockstars
MIT License
367 stars 66 forks source link

Do not rewrite anchor when url_options is set #40

Closed fabn closed 9 years ago

fabn commented 9 years ago
# in my mailer class
include Roadie::Rails::Mailer

# Override url options for this mailer only
def roadie_options
  super.combine(url_options: {host: ENV['ROADIE_URL_HOST']})
end

def my_mailer
  mail_options[:from] = sender
  # ...
  roadie_mail(mail_options)
end
<!-- In erb file -->
<%= link_to t(:top), '#top' -%> <!-- Gives: <a href="#top">Top</a> -->

The delivered email contains this html:

<a href="http://roadie-host-url/#top">Top</a>

while it should not touch that anchor tag.

Mange commented 9 years ago

Good point! I can confirm that this is something that needs to be fixed. I'll look at it in the following week.

tors 16 apr 2015 19:55 Fabio Napoleoni notifications@github.com skrev:

in my mailer classinclude Roadie::Rails::Mailer

Override url options for this mailer onlydef roadie_options

super.combine(url_options: {host: ENV['ROADIE_URL_HOST']})end def my_mailer mail_options[:from] = sender

...

roadie_mail(mail_options)end

<%= link_to t(:top), '#top' -%>

The delivered email contains this html:

Top

while it should not touch that anchor tag.

— Reply to this email directly or view it on GitHub https://github.com/Mange/roadie-rails/issues/40.

Mange commented 9 years ago

I just released roadie 3.0.5 which has a fix for this. Thank you for reporting this! :heart: