ankane / ahoy_email

First-party email analytics for Rails
MIT License
1.11k stars 137 forks source link

HTML style changes #118

Closed Hamdan85 closed 5 years ago

Hamdan85 commented 5 years ago

Hi @ankane ...

Firstly, I would like to thank you for the amazing work to the comunity that you are doing. Im amazed of how many gems of yours I'm using, and they are always excelent. Im deeply grateful.

I would like to report that I'm suffering from an issue. Im using ahoy_email to track some behaviors and using subscribers to trigger some actions in that attends my business rules.

But for some reason that I cant explain, some of the styling embeded on this template (that is stored on DB and called programatically) is corrrupted when the ahoy_email is active.

I have absolutely no clue of how to proceed in this matter because your gem is a very important part of the system lol...

Do you can imagine some reason for my HTML being changed??? again, the design works perfectly without ahoy_email.

in my mailer:

track user: @employee
mail from: @company.email_sender,
         to: "#{@employee.name} <#{@employee.email}>",
         subject: @company.caught_email_title do |format|
      format.html { render text: @template }
end
Hamdan85 commented 5 years ago

Im sorry for that @ankane ... My gem was outdated.

Closing the issue!

Hamdan85 commented 5 years ago

@ankane, actually I have updated the gem but didnt observed the new initialization methods, so it wasnt actually running.

Now that I did, I still has the same problem... some styles are being ignored... is there some html parsing that I need to be aware of?

heres a failure html example: failure.txt (rename the file to html)

It only gets wrong in gmail. In letter_opener and outlook it looks fine... it's a mistery to me!

ankane commented 5 years ago

Hey @Hamdan85, unfortunately, I don’t have the bandwidth to provide support through GitHub Issues. If you think you’ve found an issue, try to understand exactly what changes with the CSS, why that throws off Gmail and not the others, and come up with minimal steps to reproduce. Once you do that, report back.

Hamdan85 commented 5 years ago

Ok Andrew, thanks in advance.... Will do.

Em sex, 9 de nov de 2018 03:04, Andrew Kane notifications@github.com escreveu:

Hey @Hamdan85 https://github.com/Hamdan85, unfortunately, I don’t have the bandwidth to provide support through GitHub Issues. If you think you’ve found an issue, try to understand exactly what changes with the CSS, why that throws off Gmail and not the others, and come up with minimal steps to reproduce. Once you do that, report back.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ankane/ahoy_email/issues/118#issuecomment-437251360, or mute the thread https://github.com/notifications/unsubscribe-auth/ABzHSpdqnHqkLikZGLTY0OMUeiafl3E-ks5utQzygaJpZM4YRnaA .

Hamdan85 commented 5 years ago

@ankane I didnt understood what EXACTLY messes with the CSS, but I'm sure that it happens when you are reprocessing the HTML with Nokogiri inside the track_links methods in processor.rb (is not that I'm lazy, but it's very hard to diff a huge styled email html in the eye).

So, I had a hint that something was messing with inlining and choosed to reprocess it entirely with Roadie Gem... Success... everything works perfectly now..

So, my suggestions is to include RoadieGem to the method and process it. Im making a pull request in a few minutes. Hope to help.

Hamdan85 commented 5 years ago

Fixed with the pull-request #121