I know this problem has been discussed many times before, but i still face the issue that my email template is saved and stored in the database. But when i the click on send email button, on the next page the email body is empty.
Yea I forgot about this been busy But i can confirm it.
I can’t seem to get it working either. but had not had time to investigate…
Plus i was unsure if i was doing something wrong wanted to check documentation.
I have a possible fix. Do you have development experience. If so you can apply the fix. Otherwise we will have to submit this as a bug and go through the development process.
The fix is to applied in the file : application/modules/mailer/views/invoice.php
Could you please check if the demo fits your need ?
What I figured out is that, on Web page Email Quote and Email Invoice, the Body textarea field will be filled with same filed of selected email template via js function inject_email_template.
I’m not sure if this is a bug or for a certain purpose, but the function inject_email_template uses jQuery html() method to fill html content that retrieve from site_url('email_templates/ajax/get_content') into Body teatarea field, and that causes some unexpected errors.
To fix the issue, you could try the steps as below:
Use the unminified script. Edit file application/modules/layout/views/layout.php at line 46, change …assets/core/js/scripts.min.js to …assets/core/js/scripts.js.
Replace html() method with val(). Edit file assets/core/js/scripts.js at line 50, change $("#" + key).html(val); to $("#" + key).val(val);.
@oussamadouhou Thanks for your feedback. As your image shows, it seems the Body textarea still accepted email template as html code but not pure text, notice that the font size and line-height had been changed when option was selected.
Could you please try it again with Chrome incognito mode to see if script.js is loaded correctly and not cached in browser ? Hope it doesn’t inconvenience you too much.
I did try it in the incognito browser but still an empty field. If i look into the source of the page the email is somehow loaded but not passthrough the text area.
** END OF TOPIC, PLEASE GO BACK TO THE SOLUTION OF @wake