Skip to Content Skip to Menu

Templates for Mass Mailer

  • kdave321
  • kdave321
  • ONLINE
  • Posts: 191
  • Thanks: 24
  • Karma: 1
11 months 2 weeks ago - 11 months 2 weeks ago #336174 by kdave321
Templates for Mass Mailer was created by kdave321
I think you mentioned before eventually enabling templates for email, so this is just an idea to consider.

We have a set of well formatted HTML email letters I keep in the Joomla content articles, so I added a button in the Mass Mailer to fill the editor message block with the email. This example is for our welcome email but I will eventually have a select list. I had to solve several technical issues to get this to work.

JModelLegacy::addIncludePath(JPATH_BASE . '/components/com_content/models', 'ContentModel');
$model = JModelLegacy::getInstance('Article', 'ContentModel');
        $articleId = 232;
$article = $model->getItem($articleId)->introtext;
$article = str_replace(array("\r\n", "\n", "\r"), ' ', $article);
$article = str_replace('\'', '‘', $article);
$article = "'".$article."'";
$button = '<button class="button" onclick="clickme();">Welcome Letter</button><script>function clickme() {  tinymce.activeEditor.setContent('.$article.')}</script>'."\r\n";

and $button is put before the div on line 125 ('MASS_MAILER_MESSAGE_LABEL') of administrator/components/com_comprofiler/view/view.users.php

Of course, the HTML email article contains the replacement parameters, like [NAME], appropriate for the Mass Mailer.
Last edit: 11 months 2 weeks ago by kdave321. Reason: addition

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
11 months 2 weeks ago #336176 by krileon
Replied by krileon on topic Templates for Mass Mailer
We won't have email templating until CB 3.x. I'm looking into PHP libraries for it because straight HTML to Email is pretty tricky. Especially so when it comes to scoping CSS to the email. With a library we'd ideally just have layout files you could customize/override/create that would properly and safely process into email HTML.

I don't have a timeframe for this though so your solution is an excellent one for the time being. Have you considered turning it into a Joomla editor plugin extension and releasing it on the JED?


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • kdave321
  • kdave321
  • ONLINE
  • Posts: 191
  • Thanks: 24
  • Karma: 1
11 months 2 weeks ago #336177 by kdave321
Replied by kdave321 on topic Templates for Mass Mailer
Thanks. I will consider that when I've made it work more generically.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum