diff --git a/skin/images/sancho/sancho_footer.jpg b/skin/images/sancho/sancho_footer.jpg new file mode 100644 index 000000000..1e0b536c9 Binary files /dev/null and b/skin/images/sancho/sancho_footer.jpg differ diff --git a/skin/images/sancho/sancho_header.jpg b/skin/images/sancho/sancho_header.jpg new file mode 100644 index 000000000..051a05c54 Binary files /dev/null and b/skin/images/sancho/sancho_header.jpg differ diff --git a/skin/images/sancho/sancho_header_TEMPLATE.jpg b/skin/images/sancho/sancho_header_TEMPLATE.jpg new file mode 100644 index 000000000..c237afb96 Binary files /dev/null and b/skin/images/sancho/sancho_header_TEMPLATE.jpg differ diff --git a/skin/images/sancho/sancho_header_deadline_ampel_overdue.jpg b/skin/images/sancho/sancho_header_deadline_ampel_overdue.jpg new file mode 100644 index 000000000..662afab92 Binary files /dev/null and b/skin/images/sancho/sancho_header_deadline_ampel_overdue.jpg differ diff --git a/skin/images/sancho/sancho_header_ich_habe_neue_nachrichten_fuer_sie.jpg b/skin/images/sancho/sancho_header_ich_habe_neue_nachrichten_fuer_sie.jpg new file mode 100644 index 000000000..dc7f49361 Binary files /dev/null and b/skin/images/sancho/sancho_header_ich_habe_neue_nachrichten_fuer_sie.jpg differ diff --git a/skin/images/sancho/sancho_header_neue_nachrichten_in_ampelsystem.jpg b/skin/images/sancho/sancho_header_neue_nachrichten_in_ampelsystem.jpg new file mode 100644 index 000000000..a47bb7c0e Binary files /dev/null and b/skin/images/sancho/sancho_header_neue_nachrichten_in_ampelsystem.jpg differ diff --git a/skin/images/sancho/sancho_header_sie_haben_neue_nachrichten.jpg b/skin/images/sancho/sancho_header_sie_haben_neue_nachrichten.jpg new file mode 100644 index 000000000..e5e7962b6 Binary files /dev/null and b/skin/images/sancho/sancho_header_sie_haben_neue_nachrichten.jpg differ diff --git a/vilesci/cronjobs/ampel_erinnerungsmail.php b/vilesci/cronjobs/ampel_erinnerungsmail.php index af8a2d61a..eaef4ad17 100644 --- a/vilesci/cronjobs/ampel_erinnerungsmail.php +++ b/vilesci/cronjobs/ampel_erinnerungsmail.php @@ -34,7 +34,7 @@ $p = new phrasen($sprache); //get all notifications $ampel_obj = new ampel(); -$ampel_obj->getAll(); +$ampel_obj->getAll(); $ampel_arr = $ampel_obj->result; //filter only notifications that are not expired, not before vorlaufzeit AND email is true @@ -56,9 +56,9 @@ foreach($ampel_arr as $ampel) $overdue_user_arr = array(); if($result = $db->db_query($qry_all_ampel_user)) - { + { while($row = $db->db_fetch_object($result)) - { + { $user = $row->uid; //break if almost confirmed @@ -66,7 +66,7 @@ foreach($ampel_arr as $ampel) break; //check if notification is new (within last week, as cronjob will run every week) - if ($datum->DateDiff (date('Y-m-d'), $insert_date) >= -7) + if($datum->DateDiff(date('Y-m-d'), $insert_date) >= -7) { $new = true; $new_user_arr[] = $user; @@ -77,28 +77,32 @@ foreach($ampel_arr as $ampel) { $overdue = true; $overdue_user_arr[] = $user; - } - } - } + } + }; + }; if ($new) { - $new_ampel_user_arr[] = array( - 'ampel_id' => $ampel->ampel_id, - 'ampel_bezeichnung' => $kurzbz, - 'user' => $new_user_arr, - 'deadline' => date('d.m.Y', $deadline)); - } + $new_ampel_user_arr[] = + array( + 'ampel_id' => $ampel->ampel_id, + 'ampel_bezeichnung' => $kurzbz, + 'user' => $new_user_arr, + 'deadline' => date('d.m.Y', $deadline) + ); + } if ($overdue) { - $overdue_ampel_user_arr[] = array( - 'ampel_id' => $ampel->ampel_id, - 'ampel_bezeichnung' => $kurzbz, - 'user' => $overdue_user_arr, - 'deadline' => date('d.m.Y', $deadline)); + $overdue_ampel_user_arr[] = + array( + 'ampel_id' => $ampel->ampel_id, + 'ampel_bezeichnung' => $kurzbz, + 'user' => $overdue_user_arr, + 'deadline' => date('d.m.Y', $deadline) + ); } -} +}; //rearrange arrays as needed to send in eMails $new_ampel_user_arr = organizeAmpelnForMail($new_ampel_user_arr); @@ -113,29 +117,31 @@ foreach ($new_ampel_user_arr as $receiver) $firstName = $person->vorname; //link to notifications system site - $link = APP_ROOT . "cis/index.php?sprache=German&content_id=&menu=" . APP_ROOT . "cis/menu.php?content_id=&content=" . APP_ROOT . "cis/private/tools/ampelverwaltung.php"; + $link = APP_ROOT. "cis/index.php?sprache=German&content_id=&menu=". + APP_ROOT. "cis/menu.php?content_id=&content=". + APP_ROOT. "cis/private/tools/ampelverwaltung.php"; //eMail data - $to = $receiver['user'] . '@' . DOMAIN; - $from = 'noreply@'.DOMAIN; + $to = $receiver['user']. '@'. DOMAIN; + $from = 'noreply@'. DOMAIN; $subject = 'Sie haben eine neue Ampel!'; - $title = "Sie haben neue Nachrichten in Ihrem Ampelsystem!"; - $content = "

Hallo " . $firstName . ",

"; + $headerImg = "sancho_header_neue_nachrichten_in_ampelsystem.jpg"; + $content = "

Hallo ". $firstName. ",


"; $content .= "

es gibt neue Ampeln für Sie:


"; for ($i = 0; $i < count($receiver) - 1; $i++) { $receiver[$i]['ampel_id']; - $content .= "

NEU:  " . $receiver[$i]['ampel_bezeichnung'] . "

"; + $content .= "

". strtoupper($receiver[$i]['ampel_bezeichnung']). "


"; } - $content .= "

Sie können sie jetzt gleich in Ihrem Ampelsystem bestätigen:

"; - $content .= "
Zu meinem Ampelsystem
"; - $content .= "


Schönen Tag noch,

"; - $content .= "

Sancho

"; + $content .= "

Sie können sie jetzt gleich in Ihrem Ampelsystem bestätigen:

"; + $content .= "Zu meinem Ampelsystem
"; + $content .= "


Schönen Tag noch,
"; + $content .= "Sancho


"; //send eMail - sendMail($to, $from, $subject, $content, $title); + sendMail($to, $from, $subject, $content, $headerImg); } //send eMail for overdue notifications @@ -147,30 +153,32 @@ foreach ($overdue_ampel_user_arr as $receiver) $firstName = $person->vorname; //link to notifications system site - $link = APP_ROOT . "cis/index.php?sprache=German&content_id=&menu=" . APP_ROOT . "cis/menu.php?content_id=&content=" . APP_ROOT . "cis/private/tools/ampelverwaltung.php"; + $link = APP_ROOT. "cis/index.php?sprache=German&content_id=&menu=". + APP_ROOT. "cis/menu.php?content_id=&content=". + APP_ROOT. "cis/private/tools/ampelverwaltung.php"; //eMail data $to = $receiver['user'] . '@' . DOMAIN; $from = 'noreply@'.DOMAIN; $subject = 'Bestätigen Sie bitte Ihre Ampel!'; - $title = "Die Deadline für Ihre Ampel ist überschritten!"; - $content = "

Hallo " . $firstName . ",

"; - $content .= "

es gibt Ampeln, die von Ihnen noch bestätigt werden müssen:


"; + $headerImg = "sancho_header_deadline_ampel_overdue.jpg"; + $content = "

Hallo " . $firstName . ",


"; + $content .= "

diese Ampeln müssen von Ihnen noch bestätigt werden:


"; for ($i = 0; $i < count($receiver) - 1; $i++) { $receiver[$i]['ampel_id']; - $content .= "

BESTÄTIGUNG FEHLT:  " . $receiver[$i]['ampel_bezeichnung'] . "

"; - $content .= "

Die Deadline für die Bestätigung war am " . $receiver[$i]['deadline'] . "


"; + $content .= "

" . strtoupper($receiver[$i]['ampel_bezeichnung']) . "
"; + $content .= "Die Deadline für die Bestätigung war am " . $receiver[$i]['deadline'] . "


"; } - $content .= "

Sie können sie jetzt gleich in Ihrem Ampelsystem bestätigen:

"; - $content .= "
Zu meinem Ampelsystem
"; - $content .= "


Schönen Tag noch,

"; - $content .= "

Sancho

"; + $content .= "

Sie können sie jetzt gleich in Ihrem Ampelsystem bestätigen:

"; + $content .= "Zu meinem Ampelsystem
"; + $content .= "


Schönen Tag noch!
"; + $content .= "Sancho


"; //send eMail - sendMail($to, $from, $subject, $content, $title); + sendMail($to, $from, $subject, $content, $headerImg); } @@ -234,10 +242,10 @@ function organizeAmpelnForMail ($ampel_user_arr) } return $unique_user_arr; } -function sendMail($to, $from, $subject, $html_content, $title = 'Sancho hat neue Nachrichten für Sie!') +function sendMail($to, $from, $subject, $html_content, $headerImg = 'sancho_header_sie_haben_neue_nachrichten.jpg') { - $sancho_img = APP_ROOT . "skin/images/sancho_round_right_blue.png"; - $logo_img = APP_ROOT . "skin/images/fh_logo.png"; + $sanchoHeader_img = APP_ROOT . "skin/images/sancho/" . $headerImg; + $sanchoFooter_img = APP_ROOT . "skin/images/sancho/sancho_footer.jpg"; //mail content as plain text (fallback if html not activated) $plain_text = "Hallo,\n\n"; @@ -249,6 +257,7 @@ function sendMail($to, $from, $subject, $html_content, $title = 'Sancho hat neue /* * no css styles in html-head (email clients picky about that) * tables inside tables for correct styles in different email clients + * border-collapse and mso-table: this corrects strange behavior of outlook 2013 adding unwished extra space */ $html_text = ' @@ -256,26 +265,24 @@ function sendMail($to, $from, $subject, $html_content, $title = 'Sancho hat neue Sancho Ampelmail
- +
-
- + -
+ - -
- sancho_face - -

' . $title . '

+
+ sancho_header
- +
+ - @@ -283,14 +290,11 @@ function sendMail($to, $from, $subject, $html_content, $title = 'Sancho hat neue -
+
' . $html_content . '
- +
+ - -
- So spannend kann Technik sein! - - logo + + sancho_footer
@@ -302,14 +306,10 @@ function sendMail($to, $from, $subject, $html_content, $title = 'Sancho hat neue $mail = new mail($to, $from, $subject, $plain_text); $mail->setHtmlContent($html_text); - $mail->addEmbeddedImage($sancho_img, "image/png", "", "SanchoFace"); - $mail->addEmbeddedImage($logo_img, "image/png", "", "Logo"); + $mail->addEmbeddedImage($sanchoFooter_img, "image/jpg", "", "SanchoFooter"); + $mail->addEmbeddedImage($sanchoHeader_img, "image/jpg", "", "SanchoHeader"); if(!$mail->send()) echo $p->t('global/emailNichtVersendet') . ' an ' . $to . "
"; } - - - - - + \ No newline at end of file