-
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added option to set From email on smtp settings
- Loading branch information
Showing
8 changed files
with
35 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/db/ | ||
/images/uploads/logos/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
$smtpPort = $row["smtp_port"]; | ||
$smtpUsername = $row["smtp_username"]; | ||
$smtpPassword = $row["smtp_password"]; | ||
$fromEmail = $row["fromEmail"] ?? "[email protected]"; | ||
} else { | ||
echo "Notifications are disabled. No need to run."; | ||
} | ||
|
@@ -70,7 +71,7 @@ | |
$email = $user['email']; | ||
$name = $user['username']; | ||
|
||
$mail->setFrom('[email protected]', 'Wallos App'); | ||
$mail->setFrom($fromEmail, 'Wallos App'); | ||
$mail->addAddress($email, $name); | ||
|
||
$mail->Subject = 'Wallos Notification'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ | |
$smtpPort = $data["smtpport"]; | ||
$smtpUsername = $data["smtpusername"]; | ||
$smtpPassword = $data["smtppassword"]; | ||
$fromEmail = $data["fromEmail"] ?? "[email protected]"; | ||
|
||
$mail = new PHPMailer(true); | ||
$mail->isSMTP(); | ||
|
@@ -47,7 +48,7 @@ | |
$email = $user['email']; | ||
$name = $user['username']; | ||
|
||
$mail->setFrom('[email protected]', 'Wallos App'); | ||
$mail->setFrom($fromEmail, 'Wallos App'); | ||
$mail->addAddress($email, $name); | ||
|
||
$mail->Subject = 'Wallos Notification'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
// This migration adds a "from_email" column to the notifications table. | ||
|
||
/** @noinspection PhpUndefinedVariableInspection */ | ||
$columnQuery = $db->query("SELECT * FROM pragma_table_info('notifications') where name='from_email'"); | ||
$columnRequired = $columnQuery->fetchArray(SQLITE3_ASSOC) === false; | ||
|
||
if ($columnRequired) { | ||
$db->exec('ALTER TABLE notifications ADD COLUMN from_email VARCHAR(255);'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters