Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ group :test do
end

gem "bcrypt", "~> 3.1"
gem "aws-sdk-s3", "~> 1.199" # For S3 versioning support
gem "aws-sdk-s3", "~> 1.200" # For S3 versioning support
gem "aws-sdk-secretsmanager"
gem "aws-sdk-lambda"
gem "aws-sigv4"
Expand Down
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ GEM
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.3)
aws-eventstream (1.4.0)
aws-partitions (1.1172.0)
aws-partitions (1.1173.0)
aws-sdk-core (3.233.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
Expand All @@ -97,7 +97,7 @@ GEM
aws-sdk-lambda (1.161.0)
aws-sdk-core (~> 3, >= 3.231.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.199.1)
aws-sdk-s3 (1.200.0)
aws-sdk-core (~> 3, >= 3.231.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
Expand Down Expand Up @@ -314,7 +314,7 @@ GEM
puma (7.0.4)
nio4r (~> 2.0)
racc (1.8.1)
rack (3.2.2)
rack (3.2.3)
rack-session (2.1.1)
base64 (>= 0.1.0)
rack (>= 3.0.0)
Expand Down Expand Up @@ -419,7 +419,7 @@ GEM
rbs (>= 3, < 5)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (3.1.1)
rubyzip (3.2.0)
securerandom (0.4.1)
selenium-webdriver (4.36.0)
base64 (~> 0.2)
Expand Down Expand Up @@ -520,7 +520,7 @@ PLATFORMS
DEPENDENCIES
activerecord-session_store
aws-sdk-lambda
aws-sdk-s3 (~> 1.199)
aws-sdk-s3 (~> 1.200)
aws-sdk-secretsmanager
aws-sdk-ses
aws-sigv4
Expand Down
13 changes: 13 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module ApplicationHelper
include ActionView::Helpers::AssetUrlHelper
include ActionView::Helpers::AssetTagHelper

def document_source(source)
return {text: "", url: nil} unless source

Expand Down Expand Up @@ -38,4 +41,14 @@ def safe_url(url)
rescue URI::InvalidURIError
nil
end

def mailer_image_url(image)
mailer_config = Rails.configuration.action_mailer[:default_url_options]
path = image_path(image)
if mailer_config[:port]
"https://#{mailer_config[:host]}:#{mailer_config[:port]}#{path}"
else
"https://#{mailer_config[:host]}#{path}"
end
end
end
3 changes: 2 additions & 1 deletion app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
class ApplicationMailer < Devise::Mailer
layout "mailer"
helper :application

def new_account_instructions(record, token)
@token = token
@resource = record
mail(to: @resource.email, subject: "Welcome! Set up your account", template_path: "users/mailer")
mail(to: @resource.email, subject: "Welcome to the Code for America PDF Accessibility App! Set up your account", template_path: "users/mailer")
end
end
15 changes: 12 additions & 3 deletions app/views/layouts/mailer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@
border-radius: 5px;
}

#header {
#header,
#footer {
width: 100%;
margin-bottom: 32px;
text-align: center;
}

#footer {
font-size: 12px;
color: #6b7280 !important;
margin-bottom: 0;
}

#header img {
width: 120px;
display: block;
Expand All @@ -43,6 +50,7 @@
#message-body {
font-size: 14px;
line-height: 1.5;
margin-bottom: 32px;
}

a {
Expand All @@ -59,12 +67,13 @@
<div id="wrapper">
<div id="wrapper-inner">
<div id="header">
<img src="https://demo.codeforamerica.ai/assets/logo-81b734de.png" alt="The Code for America Logo"/>
<h1>Website PDF Accessibility Checker</h1>
<img src="<%= mailer_image_url("logo.png") %>" alt="Code for America Logo" />
<h1>Code for America PDF Accessibility App</h1>
</div>
<div id="message-body">
<%= yield %>
</div>
<div id="footer">Code for America, 2323 Broadway, Oakland, California 94612, USA</div>
</div>
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion config/locales/devise.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ en:
confirmation_instructions:
subject: "Confirmation instructions"
reset_password_instructions:
subject: "Reset password instructions"
subject: "Code for America PDF Accessibility App reset password instructions"
unlock_instructions:
subject: "Unlock instructions"
email_changed:
Expand Down
Loading