-
-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use premailer for HTML #178
Comments
Obviously, this is possible. However, I have not seen it implemented yet. Would be a very worthwhile feature though, although perhaps this is more something to do manually once when creating the templates? |
Well, that is of course also a good option! But the problem in my case was that the preview was incorrect. I had a * {font-family: "Helvetica Neue" arial etc} that got overwritten in many mail programs. I have manually fixed it now, but I think running a premailer before the preview would also solve this? |
Thought about it for a bit. I guess this could be implemented but I am a bit afraid of adding another (hard) dependency. I've noticed in the code that there are actually two places where templates are rendered. It would be good to abstract this out to having a single place (i.e. the templates model) and then providing a configuration option to enable premailer. If you provide a patch, make sure to provide a basic test and documentation as well. Thanks! |
@dokterbob Is it possible to do this currently? I'm using Python premailer in conjunction with another django-app (comments system), is there any way to integrate it in the current version of django-newsletter? |
I guess the most sensible way to do this is just to use template tags. Have not looked at the code but might Djang- premailer not be up to the job?
In that case it might be worth hinting at it from the docs.
|
@dokterbob Thanks for the suggestion! I've got it working well using django-premailer. Also lets me have all the emails for my site inherit from the same base, which is nice. |
Thanks for the feedback! It would be great if you could find some time to write something about this in the documentation, I’m sure many users would appreciate! |
@dokterbob I'll PR an example in the docs sometime in the next couple days :) |
Great, thanks! |
@dokterbob You mentioned earlier up that you were thinking about having/not having this as part of django-newsletter, and being enabled by a config setting. Did you have any more thoughts on what you would regard as the best solution? Options seem to be to have it as part of django-newsletter, or just indicate that people use an app such as django-premailer. |
As it is perfectly doable to have this functionality without integrating it explicitly, I'd prefer just documenting this as an optional approach, as @Sheepzez has done in #191. |
Wow, thanks! Never imagined it would be so easy to integrate it!! Thank you! |
Since peterbe's python based premailer depends on lxml, it expects pure and highly ISO/IEC/W3C compliant source html. That's why the sample in the doc is with pure html. This confused me in the first step. Because I am trying to reuse the message.html template. Inheritance would be better, but newsletter templates lack the presence of Reusing the message.html template and putting premailer tags there isn't going to work, because of the reason I mentioned above. Then what is a generic way to style the newsletter templates, especially the ones for emailing? |
@woodz- Maybe create a new ticket specifically addressing the issues you're experiencing, and then referring the one here. That way, others are better able to find it. |
I'm using the app now and it works great!
However, I would like to use a Premailer, because my mail shows up in the wrong format on some devices. Is this possible and has anyone done this before?
The text was updated successfully, but these errors were encountered: