Skip to content

Commit

Permalink
Fix HTML formatting in emails
Browse files Browse the repository at this point in the history
  • Loading branch information
chrztoph committed Dec 18, 2024
1 parent 4f72953 commit 272f052
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 36 deletions.
10 changes: 0 additions & 10 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
FROM ruby:2.7.5-bullseye
SHELL ["/bin/bash", "-c"]

EXPOSE 3000
EXPOSE 3011
EXPOSE 1080

ENV RAILS_ENV="development"
ENV RAILS_ROOT /workspace

Expand Down Expand Up @@ -66,9 +62,3 @@ RUN npm install -g yarn
# Keep bash history between runs.
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/command-history/.bash_history" \
&& echo $SNIPPET >> "/root/.bashrc"

# Install mailcatcher.
# RUN gem install mailcatcher

RUN echo 'alias ys="yarn start"' >> ~/.bashrc
RUN echo 'alias ysw="yarn start:watcher"' >> ~/.bashrc
5 changes: 5 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"../docker-compose.yml",
"docker-compose.yml"
],
"forwardPorts": [3000, 3030],
"portsAttributes": {
"3000": { "label": "App" },
"3030": { "label": "MailHog" }
},

// The 'service' property is the name of the service for the container that VS Code should
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
Expand Down
7 changes: 5 additions & 2 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ services:

ports:
- "3000:3000"
- "3011:3011"
- "1080:1080"

# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"
Expand All @@ -80,5 +78,10 @@ services:
redis:
image: redis:6.2.0-alpine

mail:
image: mailhog/mailhog:v1.0.1
ports:
- "3030:8025"

volumes:
txty-app-bash-history:
13 changes: 2 additions & 11 deletions .env.development.template
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
APP_HOST=
ASSET_HOST=
DEBUG_SECRET=

SMTP_AUTHENTICATION=
SMTP_ADDRESS=127.0.0.1
SMTP_ADDRESS=mail
SMTP_PORT=1025
SMTP_DOMAIN=127.0.0.1
SMTP_USERNAME=
Expand All @@ -12,23 +11,15 @@ SMTP_FROM_EMAIL=
SMTP_ENABLE_STARTTLS_AUTO=
SMTP_OPENSSL_VERIFY_MODE=
SMTP_TLS=

MAIL_RAISE_DELIVERY_ERRORS_DEV=
MAIL_PERFORM_DELIVERIES_DEV=

# DB_TEST_HOST=
# DB_TEST_USERNAME=

MAIL_PERFORM_DELIVERIES_DEV=true
GOOGLE_CLOUD_PROJECT=
GOOGLE_CLOUD_KEYFILE=
GOOGLE_CLOUD_OTA_BUCKET_NAME=

SENTRY_SOURCE_MAPS_AUTH_TOKEN=
SENTRY_SOURCE_MAPS_ORGANIZATION=
SENTRY_SOURCE_MAPS_PROJECT=
SENTRY_DSN_BACKEND=

DEEPL_API_TOKEN=

http_proxy=
http_proxy_deepl=
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ FROM builder AS testing

RUN bundle config --delete without
RUN bundle install
# RUN gem install mailcatcher -v 0.8.2
RUN yarn install --production=false
# RUN apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb

CMD ["bin/rails", "server"]
2 changes: 1 addition & 1 deletion app/views/devise/mailer/confirmation_instructions.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% content_for :title do %>Confirmation instructions<% end %>
<% content_for :preheader do %>Instructions to confirm your account<% end %>

<h1><%= t(:welcome).capitalize + ' ' + @resource.username %></h1>
<h1><%=h t(:welcome).capitalize + ' ' + @resource.username %></h1>

<p><%= t '.confirm_link_msg' %> </p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% content_for :preheader do %>Instructions to reset your password<% end %>

<h1>Reset your password</h1>
<p><%= t(:hello).capitalize %> <%= @resource.username %>,</p>
<p><%=h t(:hello).capitalize %> <%=h @resource.username %>,</p>
<p><%= t '.request_reset_link_msg' %></p>

<table role="presentation" border="0" cellpadding="0" cellspacing="0" class="btn btn-primary">
Expand Down
4 changes: 2 additions & 2 deletions app/views/subscription_mailer/trial_expiring.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

<h1>Your trial is expiring</h1>

<p>Hello <%= @username %>,</p>
<p>Hello <%=h @username %>,</p>

<p>the trial of your organization <%= @organization.name %> is expiring in <%= @organization.trial_days_left %> days.</p>
<p>the trial of your organization <%=h @organization.name %> is expiring in <%=h @organization.trial_days_left %> days.</p>

<p>You can manage your subscription by clicking <a href="<%= @manage_subscription_link %>">here</a>.</p>

Expand Down
2 changes: 1 addition & 1 deletion app/views/user_mailer/invite.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<p>Hello,</p>

<p>the user <b><%= @invite_from %></b> invited you to join Texterify and work together on their translations.</p>
<p>the user <b><%=h @invite_from %></b> invited you to join Texterify and work together on their translations.</p>

<% if @on_premise %>
<p>This is an invite to an on-premise instance of Texterify which can be found on <a href="<%= root_url %>"><%= root_url %></a> and is not affiliated with the cloud version of Texterify over at <a href="https://texterify.com">texterify.com</a>.</p>
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_mailer/welcome.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<h1>Welcome to Texterify</h1>

<p>Hello <%= @username %>,</p>
<p>Hello <%=h @username %>,</p>

<p>thank you for signing up.</p>

Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@ services:
- db
- redis
command: bundle exec sidekiq

redis:
image: redis:6.2.0-alpine
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,8 @@
"format": "yarn format:frontend && yarn format:backend",
"format:frontend": "prettier --write 'app/**/*.{js,ts,tsx}'",
"format:backend": "prettier --write 'app/**/*.rb'",
"start": "yarn start:mailcatcher 2> /dev/null; rm /workspace/tmp/pids/server.pid 2> /dev/null; bundle exec sidekiq & bundle exec rails server -p 3000 -b \"0.0.0.0\"",
"start:no-container-webpacker": "WEBPACKER_DEV_SERVER_PORT=3012 WEBPACKER_DEV_SERVER_PUBLIC=host.docker.internal:3012 WEBPACKER_DEV_SERVER_HOST=host.docker.internal yarn start",
"start": "bundle exec sidekiq & bundle exec rails server -p 3000 -b \"0.0.0.0\"",
"start:watcher": "./bin/webpack-dev-server",
"start:watcher:no-container-webpacker": "WEBPACKER_DEV_SERVER_PORT=3012 WEBPACKER_DEV_SERVER_PUBLIC=0.0.0.0:3012 ./bin/webpack-dev-server",
"start:mailcatcher": "mailcatcher --http-ip 0.0.0.0",
"test": "yarn test:backend",
"test:backend": "RAILS_ENV=test bundle exec rspec",
"test:backend:update": "UPDATE_SNAPSHOTS=true RAILS_ENV=test bundle exec rspec",
Expand Down

0 comments on commit 272f052

Please sign in to comment.