Skip to content

Some useful functions for implementing better looking emails that use CSS from site, for discussion if needed before inclusion in codebase.

Here are a couple of functions that we use to send out HTML emails that also look like the site by including site CSS. Specifically we have implemented them only for the emails we send out, mainly the registration and forgot password emails.

The question is that right now Tiki sends a lot of emails in non-HTML, using $mail->setText, and in other situations $mail->setHtml. So in order to send out a HTML email I need to hack the code to change $mail->setText to $mail->setHtml.

I think I heard there might be some mail revamping in Tiki potentially coming up in the future with an effort to upgrade the Webmail feature to a 3rd party system, so maybe it is too early to figure out the Tiki mail sending system.

So I'm not sure what you want to do with this merge request as it does not come with making use of these functions. If there is anyone wishing to help convert existing emails to HTML, and also to make use of these functions to make them adopt the site CSS styling at the same time, we can see if we can negotiate a reasonable payment to improve the default look of emails sent out from Tiki.

Some questions remain on optionality though, if emails should be set to send in HTML or non-HTML, and if we need to support both there should IMO be one setting that applies site wide rather than specific emails. Same with the question whether or not to include the site CSS, it should be a setting that applies site wide. Maybe the checking of these preferences can be set with $mail->setText and $mail->setHtml to avoid making too many changes to existing code?

Open to suggestions and ideas.

Edited by Nelson Ko

Merge request reports