diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/class/group.class.php | 26 |
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; + } } ?> |