Add check for @user in email template (which may not have @user) (#629)

This commit is contained in:
Ben Halpern 2018-09-11 13:27:36 -04:00 committed by GitHub
parent 7b8fff6e1a
commit 746329d4ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 16 deletions

View file

@ -228,7 +228,7 @@
function failedEmail(alert) {
alert.style.display = 'inline-block';
alert.classList.add('alert-danger');
alert.innerHTML = "Email failed to send, see console for errors";
alert.innerHTML = "Email failed to send, see console or airbrake for errors";
}
function sendEmail(id) {

View file

@ -6,23 +6,25 @@
<%= yield %>
</td>
</tr>
<tr>
<td style="padding:3% 12% 2% 4%;font-size:18px;line-height:22px;color:#7d7d7d">
<% if @user.twitter_username.blank? %>
Reminder: You used <b>GitHub</b> to authenticate your account, so use that to sign in if prompted.
<% else %>
Reminder: You used <b>Twitter</b> to authenticate your account, so use that to sign in if prompted.
<% end %>
<br/><br/>
<div style="font-size:0.78em">
<%if @unsubscribe %>
<%= link_to "Unsubscribe", email_subscriptions_unsubscribe_url(ut: @unsubscribe), style:"color:#7d7d7d" %> | <a href="https://dev.to/settings/notifications" style="color:#7d7d7d">Adjust your email settings</a>
<% if @user %>
<tr>
<td style="padding:3% 12% 2% 4%;font-size:18px;line-height:22px;color:#7d7d7d">
<% if @user.twitter_username.blank? %>
Reminder: You used <b>GitHub</b> to authenticate your account, so use that to sign in if prompted.
<% else %>
Don't want to get emails like this? Adjust your email settings at <a href="https://dev.to/settings/notifications">dev.to/settings/notifications</a>
Reminder: You used <b>Twitter</b> to authenticate your account, so use that to sign in if prompted.
<% end %>
</div>
</td>
</tr>
<br/><br/>
<div style="font-size:0.78em">
<%if @unsubscribe %>
<%= link_to "Unsubscribe", email_subscriptions_unsubscribe_url(ut: @unsubscribe), style:"color:#7d7d7d" %> | <a href="https://dev.to/settings/notifications" style="color:#7d7d7d">Adjust your email settings</a>
<% else %>
Don't want to get emails like this? Adjust your email settings at <a href="https://dev.to/settings/notifications">dev.to/settings/notifications</a>
<% end %>
</div>
</td>
</tr>
<% end %>
</table>
</body>
</html>