Open maia opened 8 years ago
That attribute is to tell Roadie not to read styles from certain link or style elements, not that stylings themselves will not be inlined on elements and their children.
If you want to disable inlining for an entire email, override roadie_options for Automatic, or call the vanilla mail method for Mailer.
If you want to run Roadie on all but a few elements, the easiest way right now would be a after_transformation hook that removes the style attribute for each node in a tree.
I'm on my phone on my way to bed so I cannot type up an example right now. If you'd like some examples, just say so and I'll type some up tomorrow.
Future visitors that need this same usecase, please comment so I can see how much need there is and it might become an official feature at one point.
@Mange thanks. I do not want to disable inlining for the entire mail, but I'd want to skip adding styles to a selected group of elements (in this case the divs containing the microdata).
I'm not sure how many people already are using structured data in emails (github does, btw), but schema.org reports a usage of "Between 250,000 and 500,000 domains" for ViewAction. There's more information about the format of Microdata in the Google Gmail Markup Reference, although it seems outdated as the Markup Tester reports a "Missing required property" (I yet have to figure out the solution).
I'd be grateful if you could provide an example on how to skip/remove/… inlining for the selected tags as mentioned above whenever you have a spare moment, thanks!
Update: I just realized that the requirements for using Google Markup are quite restrictive, therefor I won't be able to use markup these days. I'd still be interested in seeing how to skip elements when inlining, but it's not of priority, on the contrary. Thanks!
Using roadie (3.1.1) and roadie-rails (1.1.0) I'm experiencing the problem of
data-roadie-ignore
being ignored. I would assume that for each tag it is passed as attribute, it will prevent adding styles.The reason for my attempt of keeping the "original" is that I'm trying to get the Gmail Markup "View Action" to work – it's not being displayed in Google Inbox, and I assume it's because the microdata is polluted with style attributes (also, the frequency with which the styles are added feel a bit redundant to me, but that will "only" increase the file size but not cause any render problems).
Here's a part of the html generated via ActionMailer::Preview:
and here's what is being sent:
So why is roadie-rails ignoring the
data-roadie-ignore
attribute, and what can I do to solve the issue?