Hi Bob,
I wonder if we can simplify the code below because if I send for many variables (em2, 3,4,5,6,7,8,9) at the same address. And most importantly, I want to know how to create conditions among its variables. Example: if there is (EM4 + EM10) or (+ EM6 EM10) then send exemple@exemple.com.
Again thank you.
Eric
I wonder if we can simplify the code below because if I send for many variables (em2, 3,4,5,6,7,8,9) at the same address. And most importantly, I want to know how to create conditions among its variables. Example: if there is (EM4 + EM10) or (+ EM6 EM10) then send exemple@exemple.com.
Again thank you.
Eric
<?php
$recipient = JRequest::getString('recipients', '', 'post');
$emails = array (
'em1' => 'exempleA@hotmail.com',
'em2' => 'exempleB@orange.fr',
'em3' => 'exempleB@orange.fr',
'em4' => 'exempleC@orange.fr',
'em5' => 'exempleC@orange.fr',
'em6' => 'exempleB@orange.fr',
);
$email_to_use = $emails[$recipient];
$form->data['email_to_use'] = $email_to_use;
$recipient2 = JRequest::getString('recipients2', '', 'post');
$emails2 = array (
'em7' => 'exempleB@orange.fr',
'em8' => 'exempleC@orange.fr',
'em9' => 'exempleB@orange.fr',
'em10' => 'esempleA@hotmail.com',
);
$email_to_use2 = $emails2[$recipient2];
$form->data['email_to_use2'] = $email_to_use2;
?>