From fed99e2d0938b10018c8264632165aad56bc2561 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Tue, 6 Jun 2017 12:19:02 -0400 Subject: 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. --- app/class/agent.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app/class/agent.class.php') 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 @@ -51,6 +54,15 @@ abstract class agent extends object return false; } + /* + * 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 -- cgit v1.2.3