summaryrefslogtreecommitdiffstats
path: root/app/class
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-06-06 13:20:31 -0400
committerMalf Furious <m@lfurio.us>2017-06-19 23:57:39 -0400
commitb8db87d3b814b1845e8282c066a895d9dcb5a0a9 (patch)
tree8fc137c5c626974483be306df0919685c8e3a613 /app/class
parent613ef13e809c3f083a76797c7706935d3bbfcb29 (diff)
downloadscrott-b8db87d3b814b1845e8282c066a895d9dcb5a0a9.tar.gz
scrott-b8db87d3b814b1845e8282c066a895d9dcb5a0a9.zip
Implement function sendEmail() for group class
Diffstat (limited to 'app/class')
-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;
+ }
}
?>