diff options
author | Malf Furious <m@lfurio.us> | 2017-06-06 12:19:02 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2017-06-19 23:57:39 -0400 |
commit | fed99e2d0938b10018c8264632165aad56bc2561 (patch) | |
tree | d39ab3f7da5821a6f2357d915d64f869ea201d00 | |
parent | 3fea275e10abf8281088e9c7f0ca316df351e41f (diff) | |
download | scrott-fed99e2d0938b10018c8264632165aad56bc2561.tar.gz scrott-fed99e2d0938b10018c8264632165aad56bc2561.zip |
Move sendEmail() function into agent class
Adding this as an abstract function to class agent. Since we will only
be sending emails to stored users (and groups) this makes more sense and
allows us to remove this function from the global namespace as well.
-rw-r--r-- | app/class/agent.class.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/class/agent.class.php b/app/class/agent.class.php index a2c8c2e..ed50b93 100644 --- a/app/class/agent.class.php +++ b/app/class/agent.class.php @@ -14,6 +14,9 @@ require_once "class/object.class.php"; require_once "class/pad.class.php"; +require_once "class/settings.class.php"; +require_once "class/phpmailer.class.php"; +require_once "class/smtp.class.php"; /* * This is a supertype for users and groups, since these two object types @@ -52,6 +55,15 @@ abstract class agent extends object } /* + * Send an email message to this agent using stored configuration + * parameters. If config is not established, delivery is not + * attempted. Return status. + */ + public abstract function sendEmail(string $subj, string $mesg, + ?string $attachPath = NULL, ?string $attachName = NULL, + bool $ignoreEmailConf = false) : bool; + + /* * Get the display name for this agent. For groups this is the * object name; for users, this is the object name, unless an * alias is set. |