-
Notifications
You must be signed in to change notification settings - Fork 5
Add send mail to developer #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
RobinTheHood
merged 7 commits into
RobinTheHood:master
from
shopbetreuung:add-send-mail-to-developer
Aug 11, 2020
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6f0fd2d
feat: add send mail to developer
42d1e7b
feat: add send mail to developer
cd9cd24
Merge branch 'add-send-mail-to-developer' of https://github.com/shopb…
bcf48c7
small_change
1a02c9d
small fix
e12ea0a
fix: corrected german umlauts,
0ab220d
fix: send domain in mail
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,57 @@ | ||
| <?php | ||
|
|
||
| /* | ||
| * This file is part of MMLC - ModifiedModuleLoaderClient. | ||
| * | ||
| * (c) Robin Wieschendorf <mail@robinwieschendorf.de> | ||
| * | ||
| * For the full copyright and license information, please view the LICENSE | ||
| * file that was distributed with this source code. | ||
| */ | ||
|
|
||
| namespace RobinTheHood\ModifiedModuleLoaderClient; | ||
|
|
||
| use RobinTheHood\ModifiedModuleLoaderClient\ShopInfo; | ||
| use RobinTheHood\ModifiedModuleLoaderClient\Notification; | ||
| use RobinTheHood\ModifiedModuleLoaderClient\Helpers\ArrayHelper; | ||
|
|
||
| class SendMail | ||
| { | ||
| public function sendFeedback() | ||
| { | ||
| $fromEmail = ArrayHelper::getIfSet($_POST, 'email', ''); | ||
| $from = ArrayHelper::getIfSet($_POST, 'name', ''); | ||
| $message = ArrayHelper::getIfSet($_POST, 'message', ''); | ||
| if ($fromEmail == '' || $from == '' || $message == '') { | ||
| Notification::pushFlashMessage( | ||
| [ | ||
| 'text' => 'Warnung: Felder können nicht leer gelassen werden.', | ||
| 'type' => 'error' | ||
| ] | ||
| ); | ||
| return; | ||
| } | ||
| $to = 'info@module-loader.de'; | ||
| $subject = 'Report problem'; | ||
| $shopVersion = ShopInfo::getModifiedVersion(); | ||
| $message .= | ||
| '<hr />Message sent from: ' . $_SERVER['HTTP_HOST'] . | ||
| '<br />Modified version: ' . $shopVersion . | ||
| '<br />Browser: ' . $_SERVER['HTTP_USER_AGENT'] . | ||
| '<br />PHP version: ' . phpversion(); | ||
| $headers = [ | ||
| 'MIME-Version: 1.0', | ||
| 'Content-type: text/html; charset=utf-8', | ||
| 'From: ' . $from . ' <' . $fromEmail . '>' | ||
| ]; | ||
|
|
||
| if (mail($to, $subject, $message, implode("\r\n", $headers))) { | ||
| Notification::pushFlashMessage( | ||
| [ | ||
| 'text' => 'Erfolg: Die Nachricht wurde erfolgreich gesendet, wir werden so schnell wie möglich antworten.', | ||
| 'type' => 'info' | ||
| ] | ||
| ); | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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,27 @@ | ||
| <?php if (!defined('LOADED_FROM_INDEX') || LOADED_FROM_INDEX != 'true') { die('Access denied.'); }?> | ||
|
|
||
| <!DOCTYPE html> | ||
| <html lang="de"> | ||
| <head> | ||
| <?php include 'Head.tmpl.php' ?> | ||
| </head> | ||
| <body> | ||
| <?php include 'Navi.tmpl.php' ?> | ||
| <div class="content"> | ||
| <?php echo RobinTheHood\ModifiedModuleLoaderClient\Notification::renderFlashMessages() ?> | ||
| <div class="container"> | ||
| <div class="row"> | ||
| <div class="offset-4 col-4"> | ||
| <form method="POST" action="?action=reportProblem"> | ||
| <input class="mb-2 w-100" placeholder="Ihr Name" type="text" required name="name" id="name"> | ||
| <input class="mb-2 w-100" placeholder="Ihre E-mail" type="email" required name="email" id="email"> | ||
| <textarea style="resize:none;" placeholder="Ihre Nachricht" rows="6" required class="mb-2 form-control" name="message"></textarea> | ||
| <input name="send_mail" type="submit" class="button button-default" value="Nachricht absenden"> | ||
| </form> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <?php include 'Footer.tmpl.php' ?> | ||
| </body> | ||
| </html> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.