Unify format and indentation for sanitize, i18n and links on emails
In the mail section we have very different indentations and formatting in texts with sanitize, links and texts with interpolations. In my opinion it helps a lot to have clearer indentations in these cases. This may not be the best way to indent them, but at least I think it is clearer than it was and at least relatively unified.
This commit is contained in:
@@ -5,20 +5,27 @@
|
||||
</h1>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(t("mailers.budget_investment_created.intro",
|
||||
author: @investment.author.name)) %>
|
||||
<%= sanitize(
|
||||
t("mailers.budget_investment_created.intro", author: @investment.author.name)
|
||||
) %>
|
||||
</p>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(t("mailers.budget_investment_created.text",
|
||||
<%= sanitize(
|
||||
t("mailers.budget_investment_created.text",
|
||||
investment: @investment.title,
|
||||
budget: @investment.budget.name)) %>
|
||||
budget: @investment.budget.name)
|
||||
) %>
|
||||
</p>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(t("mailers.budget_investment_created.follow",
|
||||
<%= sanitize(
|
||||
t("mailers.budget_investment_created.follow",
|
||||
link: link_to(t("mailers.budget_investment_created.follow_link"), budgets_url,
|
||||
style: css_for_mailer_link)), attributes: %w[href style]) %>
|
||||
style: css_for_mailer_link)
|
||||
),
|
||||
attributes: %w[href style]
|
||||
) %>
|
||||
</p>
|
||||
|
||||
<table style="width: 100%;">
|
||||
|
||||
@@ -13,10 +13,14 @@
|
||||
</p>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(t("mailers.budget_investment_unfeasible.new",
|
||||
<%= sanitize(
|
||||
t("mailers.budget_investment_unfeasible.new",
|
||||
url: link_to(t("mailers.budget_investment_unfeasible.new_href"),
|
||||
new_budget_investment_url(@investment.budget), style: css_for_mailer_link)),
|
||||
attributes: %w[href style]) %>
|
||||
new_budget_investment_url(@investment.budget),
|
||||
style: css_for_mailer_link)
|
||||
),
|
||||
attributes: %w[href style]
|
||||
) %>
|
||||
</p>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
|
||||
@@ -18,13 +18,16 @@
|
||||
</div>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(t("mailers.config.unsubscribe_text",
|
||||
<%= sanitize(
|
||||
t("mailers.config.unsubscribe_text",
|
||||
notifications: link_to(
|
||||
t("mailers.config.notifications_link"),
|
||||
edit_subscriptions_url(token: @token),
|
||||
style: css_for_mailer_link
|
||||
),
|
||||
notification: User.human_attribute_name(:email_on_comment)
|
||||
), attributes: %w[href style]) %>
|
||||
),
|
||||
attributes: %w[href style]
|
||||
) %>
|
||||
</p>
|
||||
</td>
|
||||
|
||||
@@ -21,10 +21,14 @@
|
||||
</table>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(t("mailers.direct_message_for_receiver.unsubscribe_text",
|
||||
notifications: link_to(t("mailers.config.notifications_link"),
|
||||
<%= sanitize(
|
||||
t("mailers.direct_message_for_receiver.unsubscribe_text",
|
||||
notifications: link_to(
|
||||
t("mailers.config.notifications_link"),
|
||||
edit_subscriptions_url(token: @token),
|
||||
style: css_for_mailer_link)),
|
||||
attributes: %w[href style]) %>
|
||||
style: css_for_mailer_link)
|
||||
),
|
||||
attributes: %w[href style]
|
||||
) %>
|
||||
</p>
|
||||
</td>
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
</h1>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(t("mailers.direct_message_for_sender.text",
|
||||
receiver: @direct_message.receiver.name)) %>
|
||||
<%= sanitize(t("mailers.direct_message_for_sender.text", receiver: @direct_message.receiver.name)) %>
|
||||
</p>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
|
||||
@@ -9,17 +9,23 @@
|
||||
</p>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(t("mailers.email_verification.instructions",
|
||||
<%= sanitize(
|
||||
t("mailers.email_verification.instructions",
|
||||
verification_link: link_to(
|
||||
t("mailers.email_verification.click_here_to_verify"),
|
||||
email_url(email_verification_token: @token), style: css_for_mailer_link)),
|
||||
attributes: %w[href style]) %>
|
||||
email_url(email_verification_token: @token),
|
||||
style: css_for_mailer_link)
|
||||
),
|
||||
attributes: %w[href style]
|
||||
) %>
|
||||
</p>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(t("mailers.email_verification.instructions_2",
|
||||
<%= sanitize(
|
||||
t("mailers.email_verification.instructions_2",
|
||||
document_type: humanize_document_type(@document_type),
|
||||
document_number: @document_number)) %>
|
||||
document_number: @document_number)
|
||||
) %>
|
||||
</p>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
|
||||
@@ -9,11 +9,12 @@
|
||||
</p>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(t(
|
||||
"mailers.evaluation_comment.new_comment_by",
|
||||
<%= sanitize(
|
||||
t("mailers.evaluation_comment.new_comment_by",
|
||||
commenter: @email.comment.author.name,
|
||||
investment: valuation_comments_link(@email.commentable)
|
||||
)) %>
|
||||
)
|
||||
) %>
|
||||
</p>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
</p>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= link_to t("mailers.machine_learning_error.link"), admin_machine_learning_url,
|
||||
<%= link_to t("mailers.machine_learning_error.link"),
|
||||
admin_machine_learning_url,
|
||||
style: "color: #2895F1; text-decoration:none;" %>
|
||||
</p>
|
||||
</td>
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
</p>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= link_to t("mailers.machine_learning_success.link"), admin_machine_learning_url,
|
||||
<%= link_to t("mailers.machine_learning_success.link"),
|
||||
admin_machine_learning_url,
|
||||
style: "color: #2895F1; text-decoration:none;" %>
|
||||
</p>
|
||||
</td>
|
||||
|
||||
@@ -5,13 +5,16 @@
|
||||
</p>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(t("mailers.config.unsubscribe_text",
|
||||
<%= sanitize(
|
||||
t("mailers.config.unsubscribe_text",
|
||||
notifications: link_to(
|
||||
t("mailers.config.notifications_link"),
|
||||
edit_subscriptions_url(token: @token),
|
||||
style: css_for_mailer_link
|
||||
),
|
||||
notification: User.human_attribute_name(:newsletter)
|
||||
), attributes: %w[href style]) %>
|
||||
),
|
||||
attributes: %w[href style]
|
||||
) %>
|
||||
</p>
|
||||
</td>
|
||||
|
||||
@@ -43,9 +43,14 @@
|
||||
<tr>
|
||||
<td>
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(link_to(t("mailers.proposal_notification_digest.unfollow"),
|
||||
<%= sanitize(
|
||||
link_to(
|
||||
t("mailers.proposal_notification_digest.unfollow"),
|
||||
proposal_url(notification.notifiable.proposal),
|
||||
style: css_for_mailer_link), attributes: %w[href style]) %>
|
||||
style: css_for_mailer_link
|
||||
),
|
||||
attributes: %w[href style]
|
||||
) %>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -58,10 +63,14 @@
|
||||
<% end %>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(t("mailers.proposal_notification_digest.unsubscribe_text",
|
||||
notifications: link_to(t("mailers.config.notifications_link"),
|
||||
<%= sanitize(
|
||||
t("mailers.proposal_notification_digest.unsubscribe_text",
|
||||
notifications: link_to(
|
||||
t("mailers.config.notifications_link"),
|
||||
edit_subscriptions_url(token: @token),
|
||||
style: css_for_mailer_link)),
|
||||
attributes: %w[href style]) %>
|
||||
style: css_for_mailer_link)
|
||||
),
|
||||
attributes: %w[href style]
|
||||
) %>
|
||||
</p>
|
||||
</td>
|
||||
|
||||
@@ -18,13 +18,16 @@
|
||||
</div>
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(t("mailers.config.unsubscribe_text",
|
||||
<%= sanitize(
|
||||
t("mailers.config.unsubscribe_text",
|
||||
notifications: link_to(
|
||||
t("mailers.config.notifications_link"),
|
||||
edit_subscriptions_url(token: @token),
|
||||
style: css_for_mailer_link
|
||||
),
|
||||
notification: User.human_attribute_name(:email_on_comment_reply)
|
||||
), attributes: %w[href style]) %>
|
||||
),
|
||||
attributes: %w[href style]
|
||||
) %>
|
||||
</p>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user