summaryrefslogtreecommitdiffstats
path: root/app/class/group.class.php
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-06-20 00:17:17 -0400
committerMalf Furious <m@lfurio.us>2017-06-20 00:17:17 -0400
commita4d96f0c1e9dd89df3dd189664f400680eb4e8fa (patch)
treeba0e0b0c02a7c3384306a38106ac6eebdb80b4f4 /app/class/group.class.php
parent2376aabe74528b018189982224d61a643325b114 (diff)
parent2564b9953bb7bd8e90a9865962cb9e88d4cfd218 (diff)
downloadscrott-a4d96f0c1e9dd89df3dd189664f400680eb4e8fa.tar.gz
scrott-a4d96f0c1e9dd89df3dd189664f400680eb4e8fa.zip
Merge branch 'feature/email' into dev
Diffstat (limited to 'app/class/group.class.php')
-rw-r--r--app/class/group.class.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/class/group.class.php b/app/class/group.class.php
index 5163cb8..1191d71 100644
--- a/app/class/group.class.php
+++ b/app/class/group.class.php
@@ -62,6 +62,32 @@ class group extends agent
$group->saveObj();
return $group;
}
+
+ /*
+ * Send an email message to this group using stored configuration
+ * parameters. If config is not established, delivery is not
+ * attempted. Return status. If any delivery attempts fail, the
+ * rest are aborted and false is returned.
+ */
+ public function sendEmail(string $subj, string $mesg,
+ ?string $attachPath = NULL, ?string $attachName = NULL,
+ bool $ignoreEmailConf = false) : bool
+ {
+ $owner = $this->getOwner();
+
+ if (!$owner->sendEmail($subj, $mesg, $attachPath, $attachName,
+ $ignoreEmailConf))
+ return false;
+
+ foreach ($this->getMembers() as $memb)
+ {
+ if (!$memb->sendEmail($subj, $mesg, $attachPath, $attachName,
+ $ignoreEmailConf))
+ return false;
+ }
+
+ return true;
+ }
}
?>