I have a file in my /private folder which I then use for SSR.compileTemplate and SSR.render to send nice html verification email; is it possible to style it with bootstrap as well? if so where I should put the real client-like template file ?
If its for email template you will need inline styles in order to make it work with most of the email services, so you just use a css inliner(like this one http://foundation.zurb.com/emails/inliner.html).
Another problem you might find is that some features don't work, like media queries, so its possible that your bootstrap styles don't look as you wanted.
I recommend you to use the zurb foundation emails, It has great compatibility with most of the email clients http://foundation.zurb.com/emails.html
Related
Cookiecutter-django uses:
django-allauth (which needs to send registration confirmation emails)
django-anymail configured to use mailgun.
Things are mostly working. But I can't figure out why I'm only getting plain text emails instead of HTML emails. I do have html emails defined in templates/account.
I must be missing a configuration setting someplace. But it looks like just the presense of the .html files should be enough.
So how do I get django-allauth to send html emails?
The reason why you are only getting plain text email is because django-allauth package does not contain any HTML email templates by default.
This is mentioned on the official django-allauth documentation found at https://django-allauth.readthedocs.io/en/latest/advanced.html#sending-email:
The project does not contain any HTML email templates out of the box. When you do provide these yourself, note that both the text and HTML versions of the message are sent.
You need to follow the instructions listed here (https://django-allauth.readthedocs.io/en/latest/advanced.html#sending-email) for the exact file structure + naming convention you need to use in order to create your project specific HTML templates.
You can create a versioned image in Sitecore by referencing its item url like so:
<img src="~/media/CEB3BE892F3E47E9BCEC3F357F974606.ashx">
Is there a similar way to reuse a portion of html? Say a header or footer or dropdown menu, for example.
I'm familiar with how to do this in Rails, but don't have the user privileges I'd need in Sitecore to be able to do this in anything other than html/css/js. I can't modify the templates or go into the C# code.
Depending on whether you're using Web Forms or MVC you'll want to know about either Asp.Net MVC Partial Views, or Asp.Net User Controls to create a sublayout/rendering.
However since you don't have access to the code, I don't think there's really anything you can do.
I'm writing a Django 1.4 app that will send HTML email. I'm using Django templates to render the email content, but I'm unsure how to store the templates.
I can store them in an email app (like I would other templates), but it feels silly to use a static file.
I thought about creating an Email model and storing the template code as a TextField, which would work.
I searched for better solutions and saw sendwithus.com on reddit, which is a neat idea...
Is there a Django convention for this sort of thing?
The general approach is to store email templates either globally in the project template folder or in the template folder of your email app. If you build a reusable app you can provide examples of email templates in your apps template folder, but make it possible to overwrite them via global project template (prioritize project templates before app templates in TEMPLATE_READERS, usually the default in django).
I think you other ideas are overkill for something so simple.
I need to add a currency converter and a calculator to my website that runs on the client side.
something similar to a servlet in java.
Adding a client-side "whatever" to a django project is no different than adding an image, or a video, or anything else. Django doesn't particularly care what you put into your templates. It simply renders the templates server-side to parse your template language code, and then serves up a normal web page to the client.
So the answer to your question is... Do whatever you would normally do in an html page to embed your chosen solution into the page.
The only django-specific issues here could be how to source the path to the media using template tags, which is also no different than sourcing static content like images, javascript, and css. You can read more about that on the django docs: Managing static files
I'm building a Django site, and like a blog, I'd like users to further extend the content off the site by "skinning" through templates.
I'd like to re-use Django templating for this, I've been brainstorming on this but haven't gotten a solid idea how I can do this, can I hear some of your brilliant suggestions?
Thanks!
Probably the cleanest way is to write really semantic HTML, allow various bits of it to be configured using dbsettings (e.g. site names etc), then allow the user to add their own CSS file (perhaps by allowing the path to a CSS file to be managed through dbsettings).