Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/branding/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ admin = "hpc@it.umass.edu"
admin_name = "Unity Cluster Admins"
sender = "updates@unity.rc.umass.edu"
sender_name = "Unity Cluster Updates"
pi_approve_email = "piapproval@umass.edu"
pi_approve_name = "PI Approval"

[page] ; which sql objects to use for the content on these pages
home = "home"
Expand Down
4 changes: 3 additions & 1 deletion resources/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@
$BRANDING["mail"]["support"],
$BRANDING["mail"]["support_name"],
$BRANDING["mail"]["admin"],
$BRANDING["mail"]["admin_name"]
$BRANDING["mail"]["admin_name"],
$BRANDING["mail"]["pi_approve_email"],
$BRANDING["mail"]["pi_approve_name"]
);

//
Expand Down
11 changes: 11 additions & 0 deletions resources/lib/UnityGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ public function requestGroup($send_mail = true)
"email" => $this->getOwner()->getMail()
)
);

$this->MAILER->sendMail(
"pi_approve_email",
"group_request_admin",
array(
"user" => $this->getOwner()->getUID(),
"org" => $this->getOwner()->getOrg(),
"name" => $this->getOwner()->getFullname(),
"email" => $this->getOwner()->getMail()
)
);
}
}

Expand Down
10 changes: 9 additions & 1 deletion resources/lib/UnityMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class UnityMailer extends PHPMailer
private $MSG_SUPPORT_NAME;
private $MSG_ADMIN_EMAIL;
private $MSG_ADMIN_NAME;
private $MSG_PI_APPROVAL_EMAIL;
private $MSG_PI_APPROVAL_NAME;

public function __construct(
$template_dir,
Expand All @@ -34,7 +36,9 @@ public function __construct(
$msg_support_email,
$msg_support_name,
$msg_admin_email,
$msg_admin_name
$msg_admin_name,
$msg_pi_approval_email,
$msg_pi_approval_name
) {
parent::__construct();
$this->isSMTP();
Expand Down Expand Up @@ -87,6 +91,8 @@ public function __construct(
$this->MSG_SUPPORT_NAME = $msg_support_name;
$this->MSG_ADMIN_EMAIL = $msg_admin_email;
$this->MSG_ADMIN_NAME = $msg_admin_name;
$this->MSG_PI_APPROVAL_EMAIL = $msg_pi_approval_email;
$this->MSG_PI_APPROVAL_NAME = $msg_pi_approval_name;
}

public function sendMail($recipients, $template = null, $data = null)
Expand All @@ -105,6 +111,8 @@ public function sendMail($recipients, $template = null, $data = null)

if ($recipients == "admin") {
$this->addBCC($this->MSG_ADMIN_EMAIL, $this->MSG_ADMIN_NAME);
} elseif ($recipients == "pi_approve_email") {
$this->addBCC($this->MSG_PI_APPROVAL_EMAIL, $this->MSG_PI_APPROVAL_NAME);
} else {
if (is_array($recipients)) {
foreach ($recipients as $addr) {
Expand Down