From f5a484ef6096cf2794bd36cf416f6da0da3ec219 Mon Sep 17 00:00:00 2001 From: Cristian Fasanando Date: Fri, 1 May 2009 01:38:03 +0200 Subject: [PATCH] [svn r20244] Logic change - Fixed survey invitation email : HTML not accepted - see FS#4106 (by rvelasquez) --- main/announcements/announcements.php | 6 ++++-- main/survey/survey.lib.php | 13 +++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/main/announcements/announcements.php b/main/announcements/announcements.php index 0dabf9fb55..3aacae7a8f 100644 --- a/main/announcements/announcements.php +++ b/main/announcements/announcements.php @@ -1,4 +1,4 @@ -\n".stripslashes($emailTitle)."
"; - // main part of the email + // make a change for absolute url + $newContent = str_replace('src=\"../../','src=\"'.api_get_path(WEB_PATH).'', $newContent); + // main part of the email $mail_body .= trim(stripslashes($newContent)); // signature of email: sender name and course URL after -- line $mail_body .= "
--
"; diff --git a/main/survey/survey.lib.php b/main/survey/survey.lib.php index 2c1316d376..c52cf46684 100644 --- a/main/survey/survey.lib.php +++ b/main/survey/survey.lib.php @@ -24,7 +24,7 @@ * @package dokeos.survey * @author Patrick Cool , Ghent University: cleanup, refactoring and rewriting large parts (if not all) of the code @author Julio Montoya Armas , Dokeos: Personality Test modification and rewriting large parts of the code -* @version $Id: survey.lib.php 20132 2009-04-27 19:51:24Z juliomontoya $ +* @version $Id: survey.lib.php 20244 2009-04-30 23:38:03Z cfasanando $ * * @todo move this file to inc/lib * @todo use consistent naming for the functions (save vs store for instance) @@ -4125,7 +4125,12 @@ class SurveyUtil { } } // send the email if checkboxed - if (($newUser==true || $reminder==1) && $sendmail<>0) { + if (($newUser == true || $reminder == 1) && $sendmail <> 0) { + // make a change for absolute url + if (isset($invitation_text)) { + $invitation_text = str_replace('src="../../','src="'.api_get_path(WEB_PATH).'', $invitation_text); + $invitation_text = trim(stripslashes($invitation_text)); + } SurveyUtil::send_invitation_mail($value, $invitation_code, $invitation_title, $invitation_text); $counter++; } @@ -4193,9 +4198,9 @@ class SurveyUtil { $sender_email = $noreply; } } - + api_mail_html($recipient_name, $recipient_email, $invitation_title, $full_invitation_text, $sender_name, $sender_email, $replyto); - + } /**