summaryrefslogtreecommitdiff
path: root/includes/mailer
diff options
context:
space:
mode:
authorBot <bot@myigel.name>2017-01-02 15:43:36 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-01-02 15:49:53 +0100
commitd71e7bbfad2f07f82df0c515608996d250fd4182 (patch)
tree5083a17b218c08b3a699a0bf15bec926cc2dd185 /includes/mailer
parent7313e15ce8236e19331fb6639a3a5b97c8f06ecd (diff)
Formatting
Diffstat (limited to 'includes/mailer')
-rw-r--r--includes/mailer/shifts_mailer.php52
-rw-r--r--includes/mailer/users_mailer.php6
2 files changed, 35 insertions, 23 deletions
diff --git a/includes/mailer/shifts_mailer.php b/includes/mailer/shifts_mailer.php
index fd0d32c0..e000c927 100644
--- a/includes/mailer/shifts_mailer.php
+++ b/includes/mailer/shifts_mailer.php
@@ -5,50 +5,58 @@ function mail_shift_change($old_shift, $new_shift)
$users = ShiftEntries_by_shift($old_shift["SID"]);
$old_room = Room($old_shift["RID"]);
$new_room = Room($new_shift["RID"]);
-
+
$noticable_changes = false;
-
+
$message = _("A Shift you are registered on has changed:");
$message .= "\n";
-
+
if ($old_shift["name"] != $new_shift["name"]) {
$message .= sprintf(_("* Shift type changed from %s to %s"), $old_shift["name"], $new_shift["name"]) . "\n";
$noticable_changes = true;
}
-
+
if ($old_shift["title"] != $new_shift["title"]) {
$message .= sprintf(_("* Shift title changed from %s to %s"), $old_shift["title"], $new_shift["title"]) . "\n";
$noticable_changes = true;
}
-
+
if ($old_shift["start"] != $new_shift["start"]) {
- $message .= sprintf(_("* Shift Start changed from %s to %s"), date("Y-m-d H:i", $old_shift["start"]), date("Y-m-d H:i", $new_shift["start"])) . "\n";
+ $message .= sprintf(
+ _("* Shift Start changed from %s to %s"),
+ date("Y-m-d H:i", $old_shift["start"]),
+ date("Y-m-d H:i", $new_shift["start"])
+ ) . "\n";
$noticable_changes = true;
}
-
+
if ($old_shift["end"] != $new_shift["end"]) {
- $message .= sprintf(_("* Shift End changed from %s to %s"), date("Y-m-d H:i", $old_shift["end"]), date("Y-m-d H:i", $new_shift["end"])) . "\n";
+ $message .= sprintf(
+ _("* Shift End changed from %s to %s"),
+ date("Y-m-d H:i", $old_shift["end"]),
+ date("Y-m-d H:i", $new_shift["end"])
+ ) . "\n";
$noticable_changes = true;
}
-
+
if ($old_shift["RID"] != $new_shift["RID"]) {
$message .= sprintf(_("* Shift Location changed from %s to %s"), $old_room["Name"], $new_room["Name"]) . "\n";
$noticable_changes = true;
}
-
- if (! $noticable_changes) {
+
+ if (!$noticable_changes) {
// There are no changes worth sending an E-Mail
- return;
+ return;
}
-
+
$message .= "\n";
$message .= _("The updated Shift:") . "\n";
-
+
$message .= $new_shift["name"] . "\n";
$message .= $new_shift["title"] . "\n";
$message .= date("Y-m-d H:i", $new_shift["start"]) . " - " . date("H:i", $new_shift["end"]) . "\n";
$message .= $new_room["Name"] . "\n";
-
+
foreach ($users as $user) {
if ($user["email_shiftinfo"]) {
engelsystem_email_to_user($user, '[engelsystem] ' . _("Your Shift has changed"), $message, true);
@@ -60,14 +68,14 @@ function mail_shift_delete($shift)
{
$users = ShiftEntries_by_shift($shift["SID"]);
$room = Room($shift["RID"]);
-
+
$message = _("A Shift you are registered on was deleted:") . "\n";
-
+
$message .= $shift["name"] . "\n";
$message .= $shift["title"] . "\n";
$message .= date("Y-m-d H:i", $shift["start"]) . " - " . date("H:i", $shift["end"]) . "\n";
$message .= $room["Name"] . "\n";
-
+
foreach ($users as $user) {
if ($user["email_shiftinfo"]) {
engelsystem_email_to_user($user, '[engelsystem] ' . _("Your Shift was deleted"), $message, true);
@@ -79,13 +87,13 @@ function mail_shift_assign($user, $shift)
{
if ($user["email_shiftinfo"]) {
$room = Room($shift["RID"]);
-
+
$message = _("You have been assigned to a Shift:") . "\n";
$message .= $shift["name"] . "\n";
$message .= $shift["title"] . "\n";
$message .= date("Y-m-d H:i", $shift["start"]) . " - " . date("H:i", $shift["end"]) . "\n";
$message .= $room["Name"] . "\n";
-
+
engelsystem_email_to_user($user, '[engelsystem] ' . _("Assigned to Shift"), $message, true);
}
}
@@ -94,13 +102,13 @@ function mail_shift_removed($user, $shift)
{
if ($user["email_shiftinfo"]) {
$room = Room($shift["RID"]);
-
+
$message = _("You have been removed from a Shift:") . "\n";
$message .= $shift["name"] . "\n";
$message .= $shift["title"] . "\n";
$message .= date("Y-m-d H:i", $shift["start"]) . " - " . date("H:i", $shift["end"]) . "\n";
$message .= $room["Name"] . "\n";
-
+
engelsystem_email_to_user($user, '[engelsystem] ' . _("Removed from Shift"), $message, true);
}
}
diff --git a/includes/mailer/users_mailer.php b/includes/mailer/users_mailer.php
index bae8d918..85409c8c 100644
--- a/includes/mailer/users_mailer.php
+++ b/includes/mailer/users_mailer.php
@@ -5,5 +5,9 @@
*/
function mail_user_delete($user)
{
- engelsystem_email_to_user($user, '[engelsystem] ' . _("Your account has been deleted"), _("Your angelsystem account has been deleted. If you have any questions regarding your account deletion, please contact heaven."));
+ engelsystem_email_to_user(
+ $user,
+ '[engelsystem] ' . _("Your account has been deleted"),
+ _("Your angelsystem account has been deleted. If you have any questions regarding your account deletion, please contact heaven.")
+ );
}