Joomla Extensions

Joomla extensions

PDF Print E-mail


Back

CSS in your e-mail

If you already tried to include CSS in your e-mail, you probably discovered that it was not so easy.

Why? Because depending on the Mail Server (GMail, Yahoo,...), some part of the e-mail are stripped like the CSS stylesheet even if it's directly included in your e-mail. The best solution to make sure your e-mail won't be modified by the Mail Server when the user receives it is to include inline CSS in your Newsletter. That's not a very easy solution as your Joomla content fully use the CSS stylesheet, and some WYSIWYG editors don't accept CSS inline... But you will find in this tutorial how you can write a good e-mail using the Acajoom system and still use CSS classes!

This new way of writing a Newsletter has been developed with Acajoom 2.0.x.

 

We recommend the use of the JoomlaFCK editor as the JoomlaFCK team developed a Newsletter mode which automatically convert your CSS classes into inline CSS. So you can create your Newsletter using the JoomlaFCK editor and the editor will automatically take care of the compatibility with mail clients.

 

 

Acajoom Mambot/Plugin

Since Acajoom 2.0.x, the Acajoom plugin (or the Acajoom mambot if you use Joomla 1.0.x) will be able to change all your CSS classes by inline CSS just before Acajoom sends the Newsletter. This feature can be very useful if you use the SmartNewsletter feature in Acajoom PRO to display all your Joomla content included in the SmartNewsletter.

Open the Acajoom plugin and you can see several fields to configure this feature.

 

Mambot Plugin

 

You can write inline CSS in each field and just before sending your Newsletter, Acajoom will replace all your class by this inline CSS.

Example : class="contentheader_nws" will be replaced by the value you entered for 'Style for Content Headings', here 'color:blue'.

 

If you leave one field empty, Acajoom won't replace your CSS class so you can still use an included stylesheet if you prefer.

 

Some examples of inline CSS that you can enter in the Mambot/Plugin :

color : red; to set the color of the text to red.

border : 1px solid yellow; to have a yellow border (use only in a div).

background-color : grey; to have a grey background.

font-family: geneva,arial; to configure the family of your text.

Simply with those four parameters, you can customize your Content that you include in your Newsletter to show something very nice, very easily!

But of course, you can include any inline CSS in each field.

You can also include more than one parameter like : background-color : grey; border : 1px solid yellow; color : red;

Example

I created this simple Newsletter using the default Acajoom template :

 

Newsletter

 

I configured my Acajoom Plugin (Mambot for Joomla 1.0.x) with :

Style for Content : font-size : 10pt; font-family : verdana ; background-color : #eeeeee; border : 1px solid grey; padding : 10px 10px 10px 10px;
Style for Content Headings : font-weight: bold; font-size : 14pt; color : green;

And I received my Newsletter :

 

Mailbox Newsletter

 

 

Why Acajoom doesn't replace the class when I save the Newsletter?

The reason is very simple... More and more, wysiwyg editor don't accept inline CSS. And there are right, inline CSS is not good at all for a website. But when you send an e-mail, inline CSS is the best way to make sure everybody will see the same thing. So Acajoom allows you to keep your CSS class on your site and send inline CSS. So Acajoom doesn't replace the class in your editor otherwise your WYSIWYG Editor could 'cut' it. Nevertheless, if you click on the 'Preview' button, Acajoom modify your class to display inline CSS, as if it was on your MailBox. There is a way to obtain the same result in your WYSIWYG editor and in your mailbox : include as well some CSS in your Joomla template such as contentpaneopen_nws, contentheader_nws... So your Newsletter will look good in your Archive section as well and in your WYSIWYG editor.

 

How to add more class to be automatically replaced?

You will discover very quickly that this new function is very powerful! And if you write Joomla Content, you probably use a lot of CSS classes to make sure your Joomla Content will look great with your template. With the Acajoom Mambot (Acajoom Plugin in Joomla 1.5), you can add more classes to be automatically replaced. For that, you have to edit the file 'acajoombot.xml' that you will find in the folder Joomla10\mambots\acajoom or Joomla15\plugins\acajoom.

You will find some parameters:

<param name="class_contentheading_nws" type="text" default="" label="Style for Content Headings" description="Acajoom will replace your CSS class='contentheading_nws' by the inline CSS style='YOUR FIELD'. If left blank, Acajoom won't replace it. This class is used for your Content Title" />

And you can add your own parameter :

<param name="class_contentheading" type="text" default="" label="Style for Content Headings" description="My Own Replacer" />

So Acajoom will replace class="contentheading" by style = "YOURFIELD" in your Newsletter.

Your parameter name must start with class_ and follow with the name of your class otherwise Acajoom won't recognize it.


Comments(5)
Background color

By: Andre on 2010-Jul-04 03:56:25

Hi there,


I have Acajoom News 5.1.0 installed and I`m trying to set a background color for my newsletter. I have read the information at this page but cannot find any fields to set parameters in any of my instaled plugins (Acajoom Content Bot & Acajoom User Synchronization).

Could you send more detailed information on how to set the background color?


Be the first to Add Reply

Confused about CSS

By: bludove on 2010-Jan-06 02:51:34

I have read all of your FAQ and this article and I am still unclear on how to fix the font size in my resulting email. It looks fine in the preview within Joomla, but when I receive the test in my inbox, the text is really tiny and the text I would like smaller, I can't make smaller.  How is it that I can edit my template to look how I want it to look both in the preview AND in the final resulting email.  I do not see ONE clear cut answer or tutorial on this.  Is it possible to do a video tutorial or something like that???

Please someone respond and tell me how to make my email look right.

PS - I am using apple mail.


Be the first to Add Reply

Why?

By: thesaltydog on 2009-Nov-25 14:44:56

Hi,

your procedure is very clear. But I have filled the right parameters in the plugin, and no result in the final text sent by the newsletter...

Joomla 1.5.15 and Acajoom News 3.1.6

I have no means to debug it, as the received email is coming out encoded.


See Replies (7)

Found a way to add css

By: Plunk on 2009-Sep-17 15:03:00

Hmmm, this comment editor does not accept several characters! So I have to do without!

Just put the css above your content like this:

style type="text/css"

p color:ff0000;
p.big {font-size: 20pt}

/ style

Newsletter may 15, 2009



- and more content -


Tested this, worked fine and easy! Looked good in Microsoft Outlook.


See Replies (1)

I just don't get this explanation at all

By: Plunk on 2009-Sep-17 14:35:31

Sorry, I don't see how this should work. I have joomla 1.5.14, acajoom... all the newest. acajoombot.php and acajoombot.xml.

I don't even know how to ask the right question now, the explanation above... I don't understand it at all!!!

Thanks!


See Replies (1)

Add Comment
 
© 2007-2010 Joobi Limited