Swift Mailer module is unavailable because I use Form Tools 1.5.1...
The issue comes from ft_send_email() function located in global/code/emails.php. Here is the code I modified to correct the bug:
Do this patch seems correct to you ?
Steps to reproduce:
Create a form -> Create 2 clients -> Add the 2 clients to the form -> In Emails tab check "Send email notifications to clients for form submissions" -> Select "Text & HTML" emails format(s) -> Select "Full form submission" for client Text and HTML templates -> Update -> Fill in the form and send a submission
The issue comes from ft_send_email() function located in global/code/emails.php. Here is the code I modified to correct the bug:
PHP Code:
// ADVANCED emails (email templates)
else
{
$headers_completed = false;
// loop through each client assigned to this form, and generate an email for them
for ($i=0; $i<count($user_info); $i++)
{
$client_placeholders = _ft_get_placeholder_hash($form_id, $submission_id, $user_info[$i]);
switch ($email_template)
{
case "both":
$text_content = _ft_parse_template($form_info["{$email_type}_text_email_template"], $client_placeholders);
$HTML_content = _ft_parse_template($form_info["{$email_type}_html_email_template"], $client_placeholders, true);
if (!$headers_completed)
$headers .= _ft_get_multipart_message($HTML_content, $text_content, $eol);
break;
case "text":
$message = _ft_parse_template($form_info["{$email_type}_text_email_template"], $client_placeholders);
if (!$headers_completed)
$headers .= "Content-type: text/plain; charset=UTF-8";
break;
case "html":
$message = _ft_parse_template($form_info["{$email_type}_html_email_template"], $client_placeholders, true);
if (!$headers_completed)
$headers .= "Content-type: text/html; charset=UTF-8";
break;
}
$headers_completed = true;
// only send an email to this client if they have an actual email address specified and
if (!empty($user_info[$i]['email']) && $clients_may_manage_submission[$user_info[$i]["user_id"]])
$email_info[] = array($user_info[$i]['email'], $subject, $message, $headers);
// if required, send an additional email to the site administrator (but NEVER when just testing)
if (empty($override_recipient) && $email_type == "admin" && $form_info['include_admin_email'] == "yes")
$email_info[] = array($settings['administrator_email'], $subject, $message, $headers);
}
}
Do this patch seems correct to you ?
Steps to reproduce:
Create a form -> Create 2 clients -> Add the 2 clients to the form -> In Emails tab check "Send email notifications to clients for form submissions" -> Select "Text & HTML" emails format(s) -> Select "Full form submission" for client Text and HTML templates -> Update -> Fill in the form and send a submission