Skip to content

Commit

Permalink
basic email notifications for when users are register and when user i…
Browse files Browse the repository at this point in the history
…s editted
  • Loading branch information
JamesDurhamm committed Mar 10, 2019
1 parent 1c3ae35 commit ad34b8c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions dist/packages/users/Controllers/Manager.controller.php
Expand Up @@ -39,8 +39,16 @@ public function POSTcreate(){
$resRecord->set('level',$_POST['level']);
$addRecordID = $resRecord->commit();

$resUserEmail = \Twist::Email()->create();
$resUserEmail->addTo($_POST['email']);
$resUserEmail->setSubject("Account Created");
$resUserEmail->setFrom("noreply@twist.com");
$resUserEmail->setBodyHTML("<h3>Account has been created!</h3>");
$resUserEmail->send();


\Twist::redirect('/manager/users');
echo $resUserEmail;
}
public function edit(){
return $this->_view('manager/edit_user.tpl');
Expand All @@ -55,7 +63,15 @@ public function POSTedit(){
$resUser->password($_POST['password']);
$updateRecord = $resUser->commit();

$resEmail = \Twist::Email()->create();
$resEmail->addTo($_POST['email']);
$resEmail->setSubject("Account Updates");
$resEmail->setFrom("noreply@twist.com");
$resEmail->setBodyHTML("<h3>Account details have been updated:</h3><p>if you didn't request these changes please contact support</p>");
$resEmail->send();

\Twist::redirect('/manager/users');
echo $resEmail;
}

/**
Expand Down

0 comments on commit ad34b8c

Please sign in to comment.