Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: asmith on January 22, 2016, 02:51:21 AM

Title: Email templates support for BBC/HTML
Post by: asmith on January 22, 2016, 02:51:21 AM
Hello,

I tried modifying Emailtemplates.{language}.php for both BBC/HTML, none of them worked. (They both sent the actual BBC or HTML)

Am I missing something? Or is it possible to add support for one of them at least?
Title: Re: Email templates support for BBC/HTML
Post by: Kindred on January 22, 2016, 07:44:49 AM
I believe that you can use HTML in the template -- of course, you also have to change the mail-type as well (don't recall where that is set)

but why?   HTML in emails is just plain annoying on any device other than a full computer.
Title: Re: Email templates support for BBC/HTML
Post by: margarett on January 22, 2016, 08:15:01 AM
This should help
http://www.simplemachines.org/community/index.php?topic=539771.msg3837291#msg3837291

BBC is not supported...
Title: Re: Email templates support for BBC/HTML
Post by: asmith on January 22, 2016, 09:48:53 AM
@margarett,
Thanks for the link. I do write private mods for myself to track the changes I'm doing to my forum. I'm familiar with the sendmail(). The point of this thread is to somehow add some solution for 2.1

@kindred,
Using HTML is not always to do fancy stuff. For example for right-to-left languages, you could wrap the email into <div style="direction: rtl"></div>. Because not all email providers auto-detect the right-to-left.

Moreover, some languages look better in some other system font. E.g. Persian looks much better in Tahoma but the system default is Arial.
In a multilingual forum, I've put $txt['lang_css'] = 'Persian-utf8.css'; in index.persian-utf8.php so that I could catch it inside index.template.php to add a custom language css.

On topic, that div could also define a new font-family for the email template.
Title: Re: Email templates support for BBC/HTML
Post by: Kindred on January 22, 2016, 10:12:02 AM
those are valid points. :)
Title: Re: Email templates support for BBC/HTML
Post by: asmith on January 22, 2016, 10:51:08 AM
Maybe just add a HTML key into each template set that needs HTML:

$txt['resend_pending_message_html'] = true;
$txt['resend_pending_message_subject'] = 'Welcome to {FORUMNAME}';
$txt['resend_pending_message_body']  = 'Click on the activation link';


and modify sendmail() to act on that. (default still would be false)