ATutor

Learning Management Tools







Pages:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


Sending html emails


  • 2011-08-12 22:18:20

    Sending html emails

    Hi. I have version 2.0 installed and I'm trying to figure out how to send an html email.

    I'm working on a modification that uses the "ATutorMailer" function and I'm trying to send this email in html format.

    The code snippet is...

    [php]
    if ($parent_row = mysql_fetch_assoc($parent_result)) {
    $mail = new ATutorMailer();

    $mail->From = 'LIVE Online Math';
    $mail->AddAddress($parent_row['email']);
    if ($thr == 0) {
    // The enrollment has expired; send the enrollment notification
    $mail->Subject = SITE_NAME . ' - ' . _AT('vbc_email_unenrolled_subject');

    if ($row['status'] == VBC_ENROLLMENT_STATUS_TRIAL) {
    $mail->Body = _AT('vbc_email_unenrolled_message_trial', SITE_NAME, get_display_name($row['member_id']), AT_print($system_courses[$row['course_id']]['title'], 'courses.title'));
    } else {
    $mail->Body = _AT('vbc_email_unenrolled_message', SITE_NAME, get_display_name($row['member_id']), AT_print($system_courses[$row['course_id']]['title'], 'courses.title'));
    }
    } else {
    // It's a reminder
    $mail->Subject = SITE_NAME . ' - ' . _AT('vbc_email_reminder_subject');
    $mail->Body = _AT($vbc_reminders[$thr], SITE_NAME, get_display_name($row['member_id']), AT_print($system_courses[$row['course_id']]['title'], 'courses.title'));
    }

    $mail->Send();
    }
    [/php]



    In viewing the email message sources that are coming currently, I see: Content-Type: text/plain; charset="utf-8"

    Thanks and please advise.

  • 2011-08-15 09:48:13

    Re: Sending html emails

    Seems your question is, in the email message that are sent out, how to set "Content-Type" to "text/html", rather than the current "text/plain". Let me know if you meant something else.

    The answer is to modify one line @ include/classes/phpmailer/atutormailer.class.php, Line 45, to,

    $this->IsHTML(true);

    Right now, the argument of this line is "false".