Welcome Guest, Not a member yet? Register   Sign In
HTML Email from file system with language support
#1

[eluser]bunal[/eluser]
Hi Coders,

I am trying to send email which has the body as physical file(email_welcome.php) on the system.

I can achieve this by having the file under view and load them into a variable

/view/mail/en/email_welcome.php
/view/mail/de/mail_welcome.php

But this way is not a good way to go if you need to have a theme based system. There will be multiple copies...

I need to have emails in language folder like below so they can referenced more easily

/language/en/mail/email_welcome.php
/language/de/mail/mail_welcome.php

What is the best practice for you guys. Any recommendation?
#2

[eluser]umefarooq[/eluser]
yes you can

Code:
$this->load->helper('language');
$lang = 'en' or 'de'
$message = $this->load->view($lang.'/email_welcome.php',$data,TRUE);
#3

[eluser]bunal[/eluser]
Seems like your answer would be still in "view" folder.

I need to have the files in "/language" folder not view.
#4

[eluser]bunal[/eluser]
Hey coders, any other thoughts pls?




Theme © iAndrew 2016 - Forum software by © MyBB