Page 1 of 1

Language E-Mail from Contact form

Posted: Thu May 07, 2020 2:30 pm
by marustiweb
Just getting started with FlatPress and noticed that the E-Mail sent from FlatPress is hard coded in english which is not so practicle based on all the various language provided by FlatPress. I had a quick look and came up with the following solution:

in contact.php change

Code: Select all

				
				$msg = "Name: \n{$arr['name']} \n\n";
				
				if (isset($arr['email']))
					$msg .= "Email: {$arr['email']}\n\n";
				if (isset($arr['url']))
					$msg .= "WWW: {$arr['url']}\n\n";
				$msg .= "Content:\n{$arr['content']}\n";
				
					$success = @utils_mail(
						(
						isset($arr['email'])? 
							$arr['email'] 
							: 
							$fp_config['general']['email']
						), 
						"Contact sent through {$fp_config['general']['title']} ", $msg );
						
to

Code: Select all

$msg = " ".$lang['contact']['message']['name']." \n{$arr['name']} \n\n";
				
				if (isset($arr['email']))
					$msg .= " ".$lang['contact']['message']['email']." {$arr['email']}\n\n";
				if (isset($arr['url']))
					$msg .= " ".$lang['contact']['message']['www']." {$arr['url']}\n\n";
				$msg .= " ".$lang['contact']['message']['content']." \n{$arr['content']}\n";
				
					$success = @utils_mail(
						(
						isset($arr['email'])? 
							$arr['email'] 
							: 
							$fp_config['general']['email']
						), 
						"".$lang['contact']['message']['subject']." {$fp_config['general']['title']} ", $msg );
in lang.contact.php add (example for german language file)

Code: Select all

	$lang['contact']['message'] = array(
		'subject'	=> 'Nachricht von',
		'name'		=> 'Name:',
		'email'		=> 'E-Mail:',
		'www'		=> 'Webseite:',
		'content'	=> 'Nachricht:',
	);

Re: Language E-Mail from Contact form

Posted: Fri May 15, 2020 3:17 pm
by blog7
Why don't use utf-8? And all we reading email in all laguages

Re: Language E-Mail from Contact form

Posted: Sun May 31, 2020 2:24 pm
by marustiweb
I dont understand how that would make a difference to the hard coded english text?
To re-produce set your side to a different language then english, enable the default contact form and send yourself a test email and check the subject and lables in that email.