jason_15 Posted September 2, 2015 Share Posted September 2, 2015 How to send out plain and htlm email[with email templates] based on user selected language? /* === GET USER SELECTED LANGUAGE === */ if(!empty($_GET['language'])){ if(in_array($_GET['language'], array('EN-US','RO'))){ $date = date_create(NULL, timezone_open(date_default_timezone_get())); date_add($date, date_interval_create_from_date_string('90 days')); $expire = date_timestamp_get($date); $_SESSION['user_language'] = $_GET['language']; setcookie('user_language', $_GET['language'], $expire); }else{ $_SESSION['user_language'] = $config['default_language']; } } else if(!empty($_SESSION['user_language'])) $language = (string) $_SESSION['user_language']; else if(!empty($_COOKIE['user_language'])) $language = (string) $_COOKIE['user_language']; else $language = $config['default_language']; require 'languages/user/'.$language.'/index.php'; /* === languages/user/EN-US/index.php === */ <?php $lang = array(); $lang['global']['welcome'] = 'Welcome %a'; # %a - username # $lang['global']['login'] = 'Login'; $lang['global']['logout'] = 'Logout'; /* ................................................... */ Quote Link to comment Share on other sites More sharing options...
requinix Posted September 2, 2015 Share Posted September 2, 2015 Where are you sending the email? Where are you loading the email template? Where is the email template located? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.