opengovernment/askthem

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

Summary

Maintainability
Test Coverage
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=320, target-densitydpi=device-dpi" />

<!--[if gte mso 9]>
<style _tmplitem="283" >
.article-content ol, .article-content ul {
   margin: 0 0 0 24px;
   padding: 0;
   list-style-position: inside;
}
</style>
<![endif]-->
</head>

<body style="width: 100% !important; background-color: #d8f2f6 !important; margin: 0; padding: 0;" bgcolor="#d8f2f6">
  <table width="100%" cellpadding="0" cellspacing="0" border="0" id="background-table" style="background-color: #d8f2f6; font-family: Roboto, Helvetica, sans-serif; color: #32515a;" bgcolor="#d8f2f6">
    <tbody>
      <tr id="header" style="border-collapse: collapse; display: block; margin: 10px 45px 10px 45px;">
        <td align="center" style="border-collapse: collapse;">
          <table width="640" cellpadding="0" cellspacing="0" border="0">
            <tbody>
              <tr style="border-collapse: collapse;">
                <div align="left">
                  <a href="http://www.askthem.io/" class="logo" style="margin-right: 25px; float: left; color: #82B7C8; text-decoration: none;">
                    <img label="AskThem" editable="true" width="135" src="http://www.askthem.io/assets/logo.png" class="w640" border="0" align="top" style="display: block !important; outline: none !important; text-decoration: none !important;" />
                  </a>
                  <p class="tagline" style="color: #82B7C8; position: relative; top: 12px;">
                    Ask questions and get answers.
                  </p>
                  <%- 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? %>
                    <% logo_url = @user.referring_partner_info[:logo] -%>
                    <%- if logo_url.present? %>
                      <% logo_url = logo_url.gsub("//", "http://") unless logo_url.include?("http") -%>
                    <%- end %>
                    <a href="<%= @user.referring_partner_info[:url] -%>" class="logo" style="margin-right: 45px; float: right; position: relative; top: -30px; text-decoration: none;">
                    <img label="<%= @user.referring_partner_info[:name] -%>" editable="true" width="135" src="<%= logo_url -%>" class="w640" border="0" align="top" style="outline: none !important; text-decoration: none !important;" />
                    </a>
                  <%- end %>
                </div>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>
      <tr id="main" style="display: block; width: 550px; background-color: #ffffff; -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.1), 0 35px 85px rgba(255, 255, 255, 0.45); -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.1), 0 35px 85px rgba(255, 255, 255, 0.45); box-shadow: 0 0 5px rgba(0, 0, 0, 0.1), 0 35px 85px rgba(255, 255, 255, 0.45); -webkit-border-radius: 0 2px 2px 0; -moz-border-radius: 0 2px 2px 0; -ms-border-radius: 0 2px 2px 0; -o-border-radius: 0 2px 2px 0; padding: 45px 45px 90px;" bgcolor="#ffffff">
        <td width="500">
          <table width="500" cellpadding="0" cellspacing="0" border="0">
            <tbody>
              <tr style="border-collapse: collapse;">
                <td width="500" style="border-collapse: collapse;">
                  <%- 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].downcase.strip.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? %>
                      <h2>Hey <%= @user.given_name %>, someone using your email submitted a question. Hopefully it was you!</h2>

                      <p>If it was you, <strong>please confirm that it's your question by visiting the following link:</strong></p>

                      <p><a style="color: #82B7C8;" href="<%= question_url(@question.state, @question.id, code: @question.confirm_code) -%>"><%= question_url(@question.state, @question.id, code: @question.confirm_code) -%></a></p>

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

                  <p>To get an answer, you need to share your question with as many people as possible.<br>&nbsp;</p>

                  <p><strong>STEP 1</strong><br>Forward this email to at least 5 friends and ask them to sign the question by clicking below and then *share it to Facebook*.<br>&nbsp;</p>

                  <p><strong>STEP 2</strong><br>Share the question on Facebook yourself. This is the <em>single most powerful</em> way to get more signers.<br>&nbsp;</p>

                  <p><strong>STEP 3</strong><br>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.<br>&nbsp;</p>

                  <p>Good luck!<br><br>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.</p>
                  <br><br>


                  <dl>
                    <dt><h3><a style="color: #82B7C8;" href="<%= question_url(@question.state, @question.id) %>"><%= @question.title %></a></h3></dt>
                    <br>

                    <dt><%= @question.subject %></dt>
                    <br>

                    <dt>
                      <span><%= link_to @question.person.name, person_url(@question.state, @question.person.id) %></span>
                      <span>(<%= person_attributes(@question.person) %>)</span>
                    </dt>
                    <br>


                    <dt><%= @question.body %></dt>
                    <br>
                  </dl>

                  <p>
                    For more tips on gathering support for this question and more info on how AskThem works, <a href="http://www.askthem.io/faq">please visit our FAQ</a>.
                  </p>
                  <p>
                      Thank you,<br><br>
                      The AskThem Team
                  </p>
                  <%- end %>
                </td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>
      <tr id="footer" style="margin-top: 45px; margin-left: 45px; margin-bottom: 90px; display: block; font-size: 14px;">
        <td width="640">
          <p align="left">
            This email was sent by
            <a href="http://www.askthem.io/" style="color: #82B7C8; text-decoration: none;">AskThem.io</a>, an open-source and non-profit platform for civic engagement<span>.</span>
          </p>
          <p align="left">
            Didn't support this question? Click
            <a href="http://askthem.desk.com" style="color: #82B7C8; text-decoration: none;">here</a> to let us know<span>.</span>
          </p>
          <p align="left">
            If you would like to stop receiving emails from
            <a href="http://www.askthem.io" style="color: #82B7C8; text-decoration: none;">AskThem.io</a>
            , simply click
            <a href="http://askthem.desk.com" style="color: #82B7C8; text-decoration: none;">unsubscribe</a><span>.</span>
          </p>
        </td>
      </tr>
    </tbody>
  </table>



<style type="text/css">
body { width: 100% !important; }
.ReadMsgBody { width: 100% !important; }
.ExternalClass { width: 100% !important; display: block !important; }
body { background-color: #d8f2f6 !important; margin: 0 !important; padding: 0 !important; }
img { outline: none !important; text-decoration: none !important; display: block !important; }
h1 a:active { color: red !important; }
h2 a:active { color: red !important; }
h3 a:active { color: red !important; }
h4 a:active { color: red !important; }
h5 a:active { color: red !important; }
h6 a:active { color: red !important; }
h1 a:visited { color: purple !important; }
h2 a:visited { color: purple !important; }
h3 a:visited { color: purple !important; }
h4 a:visited { color: purple !important; }
h5 a:visited { color: purple !important; }
h6 a:visited { color: purple !important; }
.yshortcuts a:visited { color: black !important; text-decoration: none !important; border-bottom: none !important; background: none !important; }
.yshortcuts a:hover { color: black !important; text-decoration: none !important; border-bottom: none !important; background: none !important; }
</style>
</body>

</html>