Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 19 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PHP Tests

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install PHP and PHPUnit
run: |
sudo apt-get update
sudo apt-get install -y php phpunit
- name: Run PHPUnit
run: phpunit
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,23 @@ Screenshots can enhance your article by visually representing instructions. Ensu
- Crop to focus on relevant elements.
- Remove unnecessary details.

## Configuration

The contact form uses the `SITE_OWNERS_EMAIL` environment variable to determine
where submissions are sent. If the variable is not set, emails default to
`[email protected]`.

### Setting the variable locally

```bash
export [email protected]
```

### Hosting platforms

Most hosting providers allow environment variables to be configured from their
dashboard. Define `SITE_OWNERS_EMAIL` with your preferred address to receive
emails from the contact form.
## FAQs

### How do I get involved?
Expand Down
5 changes: 2 additions & 3 deletions inc/sendEmail.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php

// Replace this with your own email address
$siteOwnersEmail = '[email protected]';

// Replace this with your own email address or set the SITE_OWNERS_EMAIL environment variable
$siteOwnersEmail = getenv('SITE_OWNERS_EMAIL') ?: '[email protected]';

if($_POST) {

Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ <h1 class="display-2 display-2--light">This is what the folks from other program
<div class="eachdiv div1">
<div class="userdetails">
<div class="imgbox">
<img src="./images/testimonials/sanskriti.jpg" alt="">
<img src="./images/testimonials/sanskriti.jpg" alt="Sanskriti Harmukh">
</div>
<div class="detbox">
<p class="name">Sanskriti Harmukh (GCE)</p>
Expand All @@ -409,7 +409,7 @@ <h4>If you are someone who is looking forward to stepping into the domain of Dev
<div class="eachdiv div2">
<div class="userdetails" style="margin-top:-10px !important">
<div class="imgbox">
<img src="./images/testimonials/animesh.jpg" alt="">
<img src="./images/testimonials/animesh.jpg" alt="Animesh Pathak">
</div>
<div class="detbox">
<p class="name" style="font-size:16px; text-align: left;">Animesh Pathak (Gold MLSA)</p>
Expand Down
8 changes: 8 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit>
<testsuites>
<testsuite name="Application Test Suite">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
</phpunit>
13 changes: 13 additions & 0 deletions tests/send_email.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
use PHPUnit\Framework\TestCase;

class SendEmailTest extends TestCase
{
public function testEnvOverridesDefault()
{
$_ENV['SITE_OWNERS_EMAIL'] = '[email protected]';
putenv('[email protected]');
require __DIR__ . '/../inc/sendEmail.php';
$this->assertSame('[email protected]', $siteOwnersEmail);
}
}