Add image to freemarker template for mail? - spring

Im using spring email with freemarker template engine to send email to customers. As part of the signature I would like to add an image, but can't seem to get the template to find the image. The email appears with an image icon, not the actual image. Any ideas?
In email-html.ftl :
<font color="#636466">
With kind regards,<br /><br />
</font>
<font color="#00747B">
Name of firm<br />
</font>
<br />
<img src="/images/icon.gif" />
The image is available at /servername/contextroot/images/icon.gif

You can't use relative image URLs in an HTML email - there's nothing for them to be relative to. You need to change your template to use a fully-qualified URL.
You can also, I believe, embed image data within the email, but that's a whole different question.

Related

How to add an image to shopify using liquid?

I am new to this and there are barely any tutorials for liquid, unlike PHP.
Here's what I want to do.
Create a simple box on a page and being able to upload an image into that box, from the theme settings area.
How would I go on about doing that?
See the Shopify wiki page on settings.html:
The settings.html file is rendered on the Theme Settings page of the Shopify Admin.
To upload an image in Theme Settings, you want the File Upload input type:
File upload
Useful for uploading assets to a theme, such as logo images, favicons, and slideshow images...
<tr>
<th>
<label for="my_file">File Upload</label>
</th>
<td>
<input type="file" name="logo.png" data-max-width="500" data-max-height="300" />
</td>
</tr>
Files uploaded through settings.html are placed in the theme's assets folder. The name of the saved file is not determined by the original file, but rather by the name attribute of the file input tag. For example, the file uploaded through the example above would be saved as logo.png. Furthermore, Shopify will convert the image to the type specified in the name attribute.
Then you can access the uploaded file via Liquid as you would normally access assets. For example:
<a id="logo" href="/" role="banner">
{{ 'logo.png' | asset_url | img_tag: shop.name }}
</a>

How can I display a Media picker image

Sorry this might be a newbie question but I am quite new to Umbraco.
I have a media picker set up on a document type, and it all works fine.
So I go to the template and enter
#Umbraco.Field("bottomRightLarge")
this only gives me the ID of the image, how can I get this to show the actual image the user has selected?
I am using UMBRACO 7 - and I have tried http://our.umbraco.org/projects/website-utilities/social-bookmarking-button/general-discussions/19360-Displaying-an-image-from-Media-Picker-in-a-web-page - but the XSLT ERRORS bug time.
Try using the umbraco image item if using webforms or umbraco media for mvc
<img src="#Umbraco.Media(model.articleImageOne).Url" alt="">
or
<umbraco:Image field="articleImageOne" runat="server" />
This worked for me
<umbraco:Macro runat="server" language="cshtml">
<img src="#Model.MediaById(Model.topleftsmall).umbracoFile" alt=""/>
</umbraco:Macro>
please note I was trying this on firefox 20.0.1, and the save just didnt work properly.

Google Custom Search and a multi tenant multi domain web application

I'm developing an application that runs on several domains.
I want to use Google Custom Search on all of them. But GCS requires to provide the domain(s) of websites to search.
Is there any way to specify domains dynamically? In theory I can have thousands of domains, and I don't like the idea of adding all of them manually.
Google provide a service where you can Create a Custom Search Engine on the fly.
To use this you have to have real links on your page and not JavaScript generated links – this is so the remote service can parse your page.
<form name="cse" id="searchbox_demo" action="http://www.google.com/cse">
<input type="hidden" name="cref" value="" />
<input type="hidden" name="ie" value="utf-8" />
<input type="hidden" name="hl" value="" />
<input name="q" type="text" size="40" />
<input type="submit" name="sa" value="Search" />
</form>
<script type="text/javascript" src="http://www.google.co.uk/cse/tools/onthefly?form=searchbox_demo&lang="></script>
stackoverflow<br />
serverfault<br />
superuser
Therefore you would need to use some mechanism to dynamically create your site list page (e.g. Ruby, Python, PHP, ASP, JSP etc). From my limited experimentation it appears that the on the fly service aggressively cache your requests for the creation of a custom search engine based on the requesting page (I'm not sure how long the cache lasts). It would therefore appear that you will not be able to add and drop search sites from your list very quickly. As a workaround you could change the url that requested the custom search box for every change.

Internationalization at HTML5

How can I change the messages of HTML5 (or doses it change according to browser's language automatically?)
For example:
<!DOCTYPE HTML>
<html>
<body>
<form action="demo_form.asp" method="get">
E-mail: <input type="email" name="user_email" /><br />
<input type="submit" />
</form>
</body>
</html>
When I run this code (from W3schools) at Opera and write a non valid e-mail address it says
Please enter a valid email address
How can I change it to another language instead of English or change the warning to what I want?
Well there are different options.
You can disable the form validation of the form (or the field) with formnovalidate and provide a custom error message with javascript (and serverside ofcourse).
You can use javascript and use the .setCustomValidity() method to provide a (custom) error message but it is intended to add extra rules to the field.
You can use x-moz-errormessage to set a custom errormessage. But using this you need to know that this is not a standard.
There are no built-in internationalisation solutions currently in HTML(5) and all proposals seem dead. However you may find the Passive Localisation JavaScript library of some use. Online demonstration can be found here.

PrettyPhoto.js using blogengine.net 2.0

I'm using BlogEngine.Net 2.0 and installed prettyphoto extension
but I dont know how to use prettyphoto in my post pages.
Thanks
You need to add:
rel="prettyPhoto"
to the anchor element surrounding your picture. Here is simple example from project site:
<img src="images/thumbnails/t_2.jpg" width="60" height="60" alt="This is the title" />

Resources