Skip to content

Commit 6a49d44

Browse files
committed
add diy notif pref + locales yml updates
1 parent 068c8ab commit 6a49d44

File tree

12 files changed

+120
-37
lines changed

12 files changed

+120
-37
lines changed

app/controllers/diy/base_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ module Diy
22
class BaseController < ApplicationController
33
before_action :redirect_in_offseason
44

5+
helper_method :current_path #, :illustration_folder, :illustration_path, :next_path, :prev_path, :has_unsure_option?, :method_name, :form_name
6+
57
private
68

79
def redirect_in_offseason
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module Diy
2+
class DiyNotificationPreferenceController < BaseController
3+
private
4+
5+
def tracking_data
6+
# @form.attributes_for(:intake).reject { |k, _| k == :sms_phone_number }
7+
end
8+
9+
def illustration_path
10+
"contact-preference.svg"
11+
end
12+
end
13+
end

app/controllers/diy/file_yourself_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ def update
1010
if @form.valid?
1111
@form.save
1212
session[:diy_intake_id] = diy_intake.id
13-
redirect_to(diy_continue_to_fsa_path)
13+
#redirect_to(diy_continue_to_fsa_path)
14+
redirect_to(diy_diy_notification_preference_path)
1415
else
1516
render :edit
1617
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class DiyNotificationPreferenceForm < Form
2+
set_attributes_for :diy_intake, :sms_notification_opt_in, :email_notification_opt_in
3+
4+
def save
5+
diy_intake.update(attributes_for(:diy_intake))
6+
end
7+
8+
def self.existing_attributes(diy_intake)
9+
HashWithIndifferentAccess.new(diy_intake.attributes)
10+
end

app/lib/navigation/diy_navigation.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ class DiyNavigation
44

55
FLOW = [
66
Diy::FileYourselfController,
7+
Diy::DiyNotificationPreferenceController,
78
Diy::ContinueToFsaController
89
].freeze
910
end
10-
end
11+
end

app/models/diy_intake.rb

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,30 @@
22
#
33
# Table name: diy_intakes
44
#
5-
# id :bigint not null, primary key
6-
# clicked_chat_with_us_at :datetime
7-
# email_address :string
8-
# filing_frequency :integer default("unfilled"), not null
9-
# locale :string
10-
# preferred_first_name :string
11-
# received_1099 :integer default("unfilled"), not null
12-
# referrer :string
13-
# source :string
14-
# token :string
15-
# zip_code :string
16-
# created_at :datetime not null
17-
# updated_at :datetime not null
18-
# visitor_id :string
5+
# id :bigint not null, primary key
6+
# clicked_chat_with_us_at :datetime
7+
# email_address :string
8+
# email_notification_opt_in :integer default("unfilled")
9+
# filing_frequency :integer default("unfilled"), not null
10+
# locale :string
11+
# preferred_first_name :string
12+
# received_1099 :integer default("unfilled"), not null
13+
# referrer :string
14+
# sms_notification_opt_in :integer default("unfilled")
15+
# source :string
16+
# token :string
17+
# zip_code :string
18+
# created_at :datetime not null
19+
# updated_at :datetime not null
20+
# visitor_id :string
1921
#
2022
class DiyIntake < ApplicationRecord
2123
attr_accessor :email_address_confirmation
2224

2325
enum received_1099: { unfilled: 0, yes: 1, no: 2 }, _prefix: :received_1099
2426
enum filing_frequency: { unfilled: 0, every_year: 1, some_years: 2, not_filed: 3 }, _prefix: :filing_frequency
27+
enum email_notification_opt_in: { unfilled: 0, yes: 1, no: 2 }, _prefix: :email_notification_opt_in
28+
enum sms_notification_opt_in: { unfilled: 0, yes: 1, no: 2 }, _prefix: :sms_notification_opt_in
2529

2630
has_secure_token :token
2731

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<% content_for :page_title, t("views.questions.notification_preference.title") %>
2+
3+
<% content_for :card do %>
4+
<%= form_with model: @form, url: diy_diy_notification_preference_path, local: true, method: "put", builder: VitaMinFormBuilder, html: { class: "form-card" } do |f| %>
5+
<h1 class="h2"><%= content_for(:page_title) %></h1>
6+
7+
<p>
8+
<%=t("diy.notification_preference.body") %>
9+
</p>
10+
11+
<% if @form.errors[:base].any? %>
12+
<div class="form-group form-group--error">
13+
<p class="text--error"><i class="icon-warning"></i>
14+
<%= @form.errors.full_messages.first %>
15+
</p>
16+
</div>
17+
<% end %>
18+
19+
<div class="form-card__stacked-checkboxes spacing-above-35">
20+
<%= f.cfa_checkbox(:email_notification_opt_in, t("views.questions.notification_preference.options.email_notification_opt_in"), options: { checked_value: "yes", unchecked_value: "no" }) %>
21+
<div class="question-with-follow-up">
22+
<div class="question-with-follow-up__question">
23+
<%= f.cfa_checkbox(:sms_notification_opt_in, t("views.questions.notification_preference.options.sms_notification_opt_in"), options: { checked_value: "yes", unchecked_value: "no", "data-follow-up": "#sms-opt-in" }) %>
24+
</div>
25+
26+
<p class="text--small spacing-above-25">
27+
<%= t("views.questions.notification_preference.note_html", terms_url: sms_terms_url, privacy_url: privacy_url) %>
28+
</p>
29+
</div>
30+
</div>
31+
32+
<%= f.continue %>
33+
<% end %>
34+
<% end %>

config/locales/en.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ en:
108108
- File taxes online on your own using our partner website. This is our quickest option for households earning under $89,000 to file taxes and collect the tax credits you are owed!
109109
- To get started, we’ll need to collect some basic information.
110110
title: File taxes on your own
111+
notification_preference:
112+
body: We will reach out about free tax filing support and other free services. We may also send surveys to improve your experience. Please select the option(s) that work best for you!
111113
documents:
112114
documents_help:
113115
show:
@@ -5785,12 +5787,14 @@ en:
57855787
one: In %{year}, did you pay any mortgage interest?
57865788
other: In %{year}, did you or your spouse pay any mortgage interest?
57875789
notification_preference:
5788-
note_html: We will not share your information with any outside parties. Message frequency will vary. Message and data rates may apply. Text HELP to 58750 for help. Text STOP to 58750 to cancel. Carriers (e.g. AT&T, Verizon, T-Mobile, Sprint, etc.) are not responsible or liable for undelivered or delayed messages. See our <a href="%{terms_url}">Terms and Conditions</a> and <a href="%{privacy_url}">Privacy Policy</a>.
5790+
below_reveal: By clicking continue, you agree to receive tax return updates, service information, and occasional surveys.
5791+
note_html: <p>By opting in, you consent to getting messages from our support team. We will not share your information with any outside parties. Message frequency will vary. Message and data rates may apply.</p><p>Text HELP to 46207 for help. Text STOP to 46207 to cancel. Carriers (e.g. AT&T, Verizon, T-Mobile, Sprint, etc.) are not responsible or liable for undelivered or delayed messages. See our <a href="%{terms_url}">Terms and Conditions</a> and <a href="%{privacy_url}">Privacy Policy</a>.</p>
57895792
options:
57905793
email_notification_opt_in: Email Me
5791-
header: We’ll need to reach out with questions and updates. Please select the option(s) that work best for you!
5794+
header: We’ll need to reach out with questions and updates about your return and information about free tax filing support and other free services. We may also send surveys to improve your experience. Please select the option(s) that work best for you!
57925795
sms_notification_opt_in: Text Me
5793-
title: What is the best way to reach you?
5796+
reveal_header: Messaging Details
5797+
title: Opt in to receive messages from us
57945798
optional_consent:
57955799
consent_to_disclose_html: <a href="%{consent_to_disclose_url}" target="_blank" rel="noopener">Consent to Disclose:</a> You allow us to send tax information to the tax software company and financial institution you specify (if any).
57965800
consent_to_use_html: <a href="%{consent_to_use_url}" target="_blank" rel="noopener">Consent to Use:</a> You allow us to count your return in reports.

config/locales/es.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ es:
108108
- Presente tus impuestos en línea por su cuenta usando nuestro sitio web asociado. ¡Esta es nuestra opción más rápida para los hogares que ganan menos de $89,000 para declarar impuestos y cobrar los créditos tributarios que se le deben!
109109
- Para comenzar, necesitaremos recopilar información básica.
110110
title: "¡Declare aquí sus impuestos usted mismo!"
111+
notification_preference:
112+
body: Pondremos en contacto con usted sobre apoyo gratuito para presentar impuestos y otros servicios gratuitos. También podríamos enviarle encuestas para mejorar su experiencia con nosotros. ¡Seleccione la(s) opción(es) que mejor se adapte(n) a usted!
111113
documents:
112114
documents_help:
113115
show:
@@ -5794,12 +5796,14 @@ es:
57945796
one: En %{year}, ¿pagó algún interés hipotecario?
57955797
other: En %{year}, ¿Pagó usted o su pareja algún interés hipotecario?
57965798
notification_preference:
5797-
note_html: La frecuencia del mensaje variará. Pueden aplicar tarifas de mensajes y datos enviados por usted a nosotros o de nosotros a usted. Envíe el texto "HELP" al 58750 para ayuda. Envía STOP al 58750 para cancelar. Los operadores (por ejemplo, AT&T, Verizon, T-Mobile, Sprint, etc.) no son responsables de los mensajes retrasados o no entregados. Consulte nuestros <a href="%{terms_url}">Términos y Condiciones</a> y <a href="%{privacy_url}">Política de Privacidad</a>.
5799+
below_reveal: Al hacer clic en Continuar, usted acepta recibir actualizaciones sobre su declaración de impuestos, información sobre nuestros servicios y encuestas ocasionales.
5800+
note_html: <p>Al aceptar, usted da su consentimiento para recibir mensajes de nuestro equipo de apoyo. No compartiremos su información con terceros. La frecuencia de los mensajes puede variar. Pueden aplicarse cargos por mensajes y datos.</p><p>Envíe el texto "HELP" al 58750 para ayuda. Envía STOP al 58750 para cancelar. Los operadores (por ejemplo, AT&T, Verizon, T-Mobile, Sprint, etc.) no son responsables de los mensajes retrasados o no entregados. Consulte nuestros <a href="%{terms_url}">Términos y Condiciones</a> y <a href="%{privacy_url}">Política de Privacidad</a>.</p>
57985801
options:
57995802
email_notification_opt_in: Envíeme un correo electrónico
5800-
header: Necesitaremos comunicarnos contigo en caso de que tengamos preguntas o actualizaciones. Por favor, selecciona la(s) opción(es) que mejor te funcione.
5803+
header: Necesitaremos ponernos en contacto con usted para hacerle preguntas y enviarle actualizaciones sobre su declaración de impuestos, así como información sobre apoyo gratuito para presentar impuestos y otros servicios gratuitos. También podríamos enviarle encuestas para mejorar su experiencia con nosotros. ¡Seleccione la(s) opción(es) que mejor se adapte(n) a usted!
58015804
sms_notification_opt_in: Mensaje de Texto
5802-
title: "¿Cuál es la mejor manera de contactarte?"
5805+
reveal_header: Detalles sobre la mensajería
5806+
title: Acepte recibir mensajes de nuestra parte
58035807
optional_consent:
58045808
consent_to_disclose_html: <a href="%{consent_to_disclose_url}" target="_blank" rel="noopener">Consentimiento para divulgar:</a> Usted nos permite enviar su información fiscal a la empresa de software de impuestos y a la institución financiera que especificó (si corresponde).
58055809
consent_to_use_html: <a href="%{consent_to_use_url}" target="_blank" rel="noopener">Consentimiento para usar:</a> Usted nos permite incluir su declaración de impuestos en informes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class AddEmailSmsNotificationOptInsToDiyIntake < ActiveRecord::Migration[7.1]
2+
def change
3+
add_column :diy_intakes, :email_notification_opt_in, :integer, default: 0
4+
add_column :diy_intakes, :sms_notification_opt_in, :integer, default: 0
5+
end
6+
end

0 commit comments

Comments
 (0)