diff --git a/Dockerfile b/Dockerfile index 9315376..fca3651 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,4 +18,15 @@ RUN apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev li RUN apt-get install -y locales RUN locale-gen en_GB.UTF-8 RUN sed -i '/en_GB.UTF-8/s/^# //g' /etc/locale.gen && \ - locale-gen \ No newline at end of file + locale-gen +RUN apt-get install -y curl +# And clean up the image +RUN rm -rf /var/lib/apt/lists/* + +RUN curl -Lsf 'https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz' | tar -C '/usr/local' -xvzf - +ENV PATH /usr/local/go/bin:$PATH +RUN go get github.com/mailhog/mhsendmail +RUN cp /root/go/bin/mhsendmail /usr/bin/mhsendmail +RUN echo 'sendmail_path = /usr/bin/mhsendmail --smtp-addr mailhog:1025' > /usr/local/etc/php/php.ini + + diff --git a/classes/subscriber.php b/classes/subscriber.php index 0fef6fd..9984513 100644 --- a/classes/subscriber.php +++ b/classes/subscriber.php @@ -190,7 +190,7 @@ Class Subscriber { global $mysqli; - + // error_log(print_r($token, TRUE)); $stmt = $mysqli->prepare("SELECT subscriberID, token, userID, active, expires FROM subscribers WHERE token LIKE ? LIMIT 1"); $stmt->bind_param("s", $token ); $stmt->execute(); @@ -202,7 +202,7 @@ Class Subscriber // No data found, fail gently... return false; } - + // error_log(print_r($row, TRUE)); // If account is not already active, check if we are within timeframe of exipre +2h // and active if so, otherwise,delete account and return falsev if ( $row['active'] <> 1 ) { diff --git a/docker-compose.yml b/docker-compose.yml index efb356c..addea76 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,5 +20,12 @@ services: MYSQL_DATABASE: server_status volumes: - ./database:/var/lib/mysql + networks: + - status-db + mailhog: + image: mailhog/mailhog + ports: + - "1025:1025" + - "8025:8025" networks: - status-db \ No newline at end of file diff --git a/libs/templates/email_status_update.html b/libs/templates/email_status_update.html index dea833e..8cbde2e 100644 --- a/libs/templates/email_status_update.html +++ b/libs/templates/email_status_update.html @@ -52,5 +52,5 @@ -

%unsubscribe%

+

%unsubscribe%

 %powered_by% Server-Status

\ No newline at end of file