Jump to content

Styling Html Email - Idea


Recommended Posts

I think that styling html email is good and using cross client/browser compatible email (also responsive) is better.
Moreover add the necessary code html and css to make it through the WYSIWYG editor of Blesta, it is virtually impossible (if it is good, after saving you lose pieces).
I image, editing email templates in Blesta, that i can select for each template a "model", stored in company folder: so i can make transactional emails more attractive and effective.
I made some changes that work for us:
- we get and update an html email from https://github.com/mailgun/transactional-email-templates;
- we put one or more placeholders (eg, "@BODY@") in this template;
- we put this template in "uploads/[COMPANY_ID]/email_templates" folder and name (e.g. "tpl_email.htm");
- we added in app/models/emails.php after row #806 

$email->html = $parser->parseString($email->html, $parser_options_html)->render($tags);

the following

Loader::loadComponents($this, array("SettingsCollection"));
                $tmp = $this->SettingsCollection->fetchSetting(null, Configure::get("Blesta.company_id"), "uploads_dir");
                $template_path = $tmp['value'] . Configure::get("Blesta.company_id") . DS . "email_templates" . DS;
                if (file_exists($template_path . "tpl_email.htm")) {
                    $tpl = file_get_contents($template_path . "tpl_email.htm");
                    $email->html = str_replace('@BODY@', $email->html, $tpl);

Attached you can see one of results. But now i like to have a more friendly management of this feature.


What do you think about?



Link to comment
Share on other sites

  • 1 month later...
  • 6 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...