opengovernment/askthem

View on GitHub
app/views/question_mailer/question_posted.text.erb

Summary

Maintainability
Test Coverage
<%- if @user.created_at && @user.created_at.to_date == Time.zone.now.to_date && @user.referring_partner_info.present? && @user.referring_partner_info[:name].present? && @user.referring_partner_info[:name].downcase.include?('honest') %>
  <%- partner_template = "#{@user.referring_partner_info[:name].strip.downcase.gsub(' ', '_')}_question_posted" %>
  <%# right now this is disabled except for honest ads -%>
  <%- if partner_template.include?("honest") %>
    <%= render partial: partner_template, locals: { user: @user, question: @question } -%>
  <%- end %>
<%- else %>

  <%- if @question.needs_confirmation? %>
  Hey <%= @user.given_name %>, someone using your email submitted a question. Hopefully it was you!

  If it was you, please confirm that it's your question by visiting the following link:

  <%= question_url(@question.state, @question.id, code: @question.confirm_code) %>

  After the question has been confirmed, we'll make it live and then it's time to organize!
  <%- else %>
  Great work, <%= @user.given_name %>, your question is posted.

  Now it's time to organize!
  <%- end %>

  To get an answer, you need to share your question with as many people as possible.

  STEP 1:

  Forward this email to at least 5 friends and ask them to sign the question by clicking below and then *share it to Facebook*.

  STEP 2:

  Share the question on Facebook yourself. This is the single most powerful way to get more signers.

  STEP 3:

  Finally, if you have a Twitter account, visit the question page and share to Twitter. This can echo to thousands of people in a very short period of time.

  Good luck!

  We hope you reach the threshold-- remember to check your progress daily and keep sharing the question. If you have any questions, please don't hesitate to email Maryam at maryam@askthem.io.

  Thank you for posting your question to AskThem, <%= @user.given_name %>

  Title
  <%= @question.title %>

  <%- if @question.subject.present? %>
    Topic
    <%= @question.subject %>
  <%- end %>

  To
  <%= @question.person.name -%> (<%= person_attributes(@question.person) %>)
  More information about <%= @question.person.name -%> can be found at <%= person_url(@question.state, @question.person.id) -%>

  Body
  <%= @question.body %>


  Here's a permalink to your question, which you can share over email and on Facebook & Twitter: <%= question_url(@question.state, @question.id) %>

  For tips about how to gather support for this question and more info on how AskThem works, please visit our FAQ: http://www.askthem.io/faq.

  Thank you,
  The AskThem Team
<%- end %>