Skip to content

Commit

Permalink
Merge pull request #334 from itk-dev/feature/FORSLAG-74-citizen-propo…
Browse files Browse the repository at this point in the history
…sal-mail

Citizen proposal notification mails
  • Loading branch information
rimi-itk authored Aug 15, 2023
2 parents 61bb40a + 535fb3b commit 2d5602f
Show file tree
Hide file tree
Showing 6 changed files with 356 additions and 52 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
Removed email from citizen proposal support form
* [PR-335](https://github.com/itk-dev/hoeringsportal/pull/335)
Hid “Author email display” from display
* [PR-333](https://github.com/itk-dev/hoeringsportal/pull/333)
* [PR-334](https://github.com/itk-dev/hoeringsportal/pull/334)
Sent notification mails on citizen proposal creation and publication

## [3.1.0] - 2023-08-04 - Citizen proposal
Expand Down
4 changes: 2 additions & 2 deletions config/sync/symfony_mailer.mailer_transport.smtp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ plugin: smtp
configuration:
user: ''
pass: ''
host: set.this.in.settings.local.php
port: null
host: mail
port: 1025
query:
verify_peer: true
local_domain: ''
Expand Down
20 changes: 10 additions & 10 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ version: "3"
services:
phpfpm:
environment:
- PHP_SENDMAIL_PATH='/usr/local/bin/mhsendmail --smtp-addr="mailhog:1025"'
- PHP_SENDMAIL_PATH=/usr/sbin/sendmail -S mail:1025

nginx:
labels:
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.middlewares=ITKBasicAuth@file"

mailhog:
image: itkdev/mailhog
mail:
image: axllent/mailpit
networks:
- app
- frontend
labels:
- "traefik.enable=true"
- "traefik.docker.network=frontend"
- "traefik.http.routers.mailhog_${COMPOSE_PROJECT_NAME}-http.rule=Host(`mailhog.${COMPOSE_SERVER_DOMAIN}`)"
- "traefik.http.routers.mailhog_${COMPOSE_PROJECT_NAME}-http.entrypoints=web"
- "traefik.http.routers.mailhog_${COMPOSE_PROJECT_NAME}-http.middlewares=redirect-to-https"
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}-http.rule=Host(`mail.${COMPOSE_SERVER_DOMAIN}`)"
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}-http.entrypoints=web"
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}-http.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
- "traefik.http.routers.mailhog_${COMPOSE_PROJECT_NAME}.rule=Host(`mailhog.${COMPOSE_SERVER_DOMAIN}`)"
- "traefik.http.routers.mailhog_${COMPOSE_PROJECT_NAME}.entrypoints=websecure"
- "traefik.http.services.mailhog_${COMPOSE_PROJECT_NAME}.loadbalancer.server.port=8025"
- "traefik.http.routers.mailhog_${COMPOSE_PROJECT_NAME}.middlewares=ITKMailhogAuth@file"
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}.rule=Host(`mail.${COMPOSE_SERVER_DOMAIN}`)"
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}.entrypoints=websecure"
- "traefik.http.services.mail_${COMPOSE_PROJECT_NAME}.loadbalancer.server.port=8025"
- "traefik.http.routers.mail_${COMPOSE_PROJECT_NAME}.middlewares=ITKMailhogAuth@file"
9 changes: 4 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ services:
environment:
- MEMCACHED_CACHE_SIZE=64

mailhog:
image: itkdev/mailhog
mail:
image: axllent/mailpit
networks:
- app
- frontend
Expand All @@ -88,8 +88,8 @@ services:
labels:
- "traefik.enable=true"
- "traefik.docker.network=frontend"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}Mailhog.rule=Host(`mailhog-${COMPOSE_DOMAIN}`)"
- "traefik.http.services.${COMPOSE_PROJECT_NAME}Mailhog.loadbalancer.server.port=8025"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}mail.rule=Host(`mail-${COMPOSE_DOMAIN}`)"
- "traefik.http.services.${COMPOSE_PROJECT_NAME}mail.loadbalancer.server.port=8025"

pretix:
image: pretix/standalone:latest
Expand All @@ -102,7 +102,6 @@ services:
depends_on:
- pretix_database
- pretix_redis
- mailhog
ports:
- '80'
volumes:
Expand Down
14 changes: 4 additions & 10 deletions web/modules/custom/hoeringsportal_citizen_proposal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ Edit `settings.local.php` and define SMTP host and port, e.g.

```php
# web/sites/default/settings.local.php
# For local development
$config['symfony_mailer.mailer_transport.smtp']['configuration']['host'] = 'mailhog';
$config['symfony_mailer.mailer_transport.smtp']['configuration']['port'] = '1025';

# For server deployment
$config['symfony_mailer.mailer_transport.smtp']['configuration']['host'] = 'host.docker.internal';
$config['symfony_mailer.mailer_transport.smtp']['configuration']['port'] = '25';
Expand Down Expand Up @@ -72,7 +68,7 @@ Tak for dit borgerforslag på [site:url-brief]
Content
<p>Hej [node:field_author_name]</p>
<p><strong>Hej [node:field_author_name]</strong></p>
<p>Tak for dit borgerforslag <em>[node:title]</em>.</p>
Expand All @@ -89,10 +85,8 @@ Nyt borgerforslag på [site:url-brief]
Content
<p>Der er kommet et nyt borgerforslag: <a href="[node:url]">[node:title]</a> <a href="[node:edit-url]">[rediger]</a></p>
<p>Venlig hilsen<br>
Deltag aarhus</p>
<p>Der er kommet et nyt borgerforslag: <br>
<strong><a href="[node:url]">[node:title]</a></strong> <a href="[node:edit-url]"> [rediger forslaget]</a></p>
# ------------------------------------------------------------------------------
# proposal_published_citizen
Expand All @@ -104,7 +98,7 @@ Dit borgerforslag på [site:url-brief] er blevet offentliggjort
Content
<p>Hej [node:field_author_name]</p>
<p><strong>Hej [node:field_author_name]</strong></p>
<p>Dit borgerforslag <a href="[node:url]"><em>[node:title]</em></a> er nu offentliggjort.</p>
Expand Down
Loading

0 comments on commit 2d5602f

Please sign in to comment.