Email Template Tips - Open Office
The following are tips and tricks to make Email Templates that generate impressive looking emails using Open Office.
Set the Content Type to Document, and if possible use an Open Office document for the Content. Avoid RTF and HTML content as these do not allow merging, and use Jasper Report (jrxml) content only if you need Jasper Reports abilities to run sub-reports. Avoid Microsoft Office content if possible, because although it does allow merging, it does not provide some of the Open Office facilities (such as conditional content).
When preparing the Open Office document, you need to be careful when you insert images. You cannot simply inset the image, and you MUST use an image that resides on a publicly accessible website (so that the person who receives the email can access the images), and you MUST link to the image.
Thus, you insert the image, use Insert|Picture|From File... and enter the URL of the image, and ensure that the Link box is ticked - as follows:
Note that the easiest way of getting the image's URL is to open the web page where it is displayed and then right click on the image, then:
In Firefox, use Copy Image Location
In Chrome, use Copy Image Address
Having inserted your image, if you want to centre or right-align it then you must do as follows:
First right-click on the image and select Anchor|As Character:
Click just after the image - by default it is left aligned:
To centre or right-align, click the appropriate icon.
Finally, in normal use, it is quite common to use empty paragraphs to space between items (as has been done above). However, you will find that doing this leads to big gaps in the email text. Just letting the paragraphs follow one after the other provides perfectly adequate spacing.
Hence, with an invoice cover-note like the following:
the generated email looks like:
Using spaces for spacing
If you have not played with HTML, you may not realise that if text in HTML documents contains multiple consecutive spaces, then these are replaced by a single space. More strictly, multiple whitespace characters are replaced by a single space. Hence if you wish to space say two graphics apart by 3 spaces, then you cannot use space characters - instead you must use 'non-breaking space' characters. In Open Office Writer and Microsoft Word you inject these using Ctrl-Shift-Space on a Windows machine or Option-Space on a Mac).
No gaps between paragraphs
The paragraph spacing used in Open Office Writer will be ignored. Hence if your text in Writer looks like:
then the email text will look like:
To bring the lines together, use 'New Lines' (Ctrl-Shift-Enter) instead, so that in Writer you have:
then the email text will look like:
Wrong font
There is a bug in Open Office 4.1.2 that results in a user field at the beginning of a paragraph being given no font specification and thus shows up as (the default) Times.
That is, if in Writer you have:
then the email text will look like:
Looking closely you will see that although the 'Regards' has font Arial, that for Dr Crossling has font Times.
If you change the paragraph mark after the Regards, to a new line, ie like:
then the email text will look like: