Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions app/views/user_mailer/invitation.html.erb
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<% content_for :message do %>
<p>
<% if !@user_name.blank? %>
<%= t(".has_invited", user_name: style_bold(@user_name)).html_safe %>
<%= t(".has_invited.html", user_name: style_bold(@user_name)) %>
Comment on lines 3 to +4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We prefer username without a space, please update these variables here for that

<% else %>
<%= t ".been_invited" %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update all t method calls in these emails to use parentheses, as explained in our i18n standards:

Suggested change
<%= t ".been_invited" %>
<%= t(".been_invited") %>

<% end %>
</p>

<p>
<%= t(".html.about", otw_link: style_link(t(".html.otw_link_text"), "https://www.transformativeworks.org")).html_safe %>
<%= t(".about.html", otw_link: style_link(t(".about.otw_link_text"), "https://www.transformativeworks.org")) %>
</p>

<p>
<%= t ".features" %>
</p>

<p>
<%= t(".html.join", invitation_link: style_link(t(".html.invitation_link_text"), signup_url(invitation_token: @invitation.token))).html_safe %>
<%= t(".join.html", invitation_link: style_link(t(".join.invitation_link_text"), signup_url(invitation_token: @invitation.token))) %>
</p>

<p>
<%= t(".html.activation_support", support_link: style_link(t(".html.support_link_text"), new_feedback_report_url)).html_safe %>
<%= t(".activation_support.html", support_link: style_link(t(".activation_support.support_link_text"), new_feedback_report_url)) %>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like slavalamp said, please update all link variables and keys in this email to conform to our i18n standards for hyperlinks:

Suggested change
<%= t(".activation_support.html", support_link: style_link(t(".activation_support.support_link_text"), new_feedback_report_url)) %>
<%= t(".activation_support.html", contact_support_link: style_link(t(".activation_support.contact_support"), new_feedback_report_url)) %>

</p>

<p>
<%= t(".html.faq", faq_link: style_link(t(".html.faq_link_text"), archive_faqs_url)).html_safe %>
<%= t(".faq.html", faq_link: style_link(t(".faq.faq_link_text"), archive_faqs_url)) %>
</p>
<% end %>
10 changes: 5 additions & 5 deletions app/views/user_mailer/invitation.text.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<% content_for :message do %>
<% if !@user_name.blank? %>
<%= t ".has_invited", user_name: @user_name %>
<%= t ".has_invited.text", user_name: @user_name %>
<% else %>
<%= t ".been_invited" %>
<% end %>

<%= t ".text.about", otw_url: "https://www.transformativeworks.org" %>
<%= t ".about.text", otw_url: "https://www.transformativeworks.org" %>

<%= t ".features" %>

<%= t ".text.join", invitation_url: signup_url(invitation_token: @invitation.token) %>
<%= t ".join.text", invitation_url: signup_url(invitation_token: @invitation.token) %>

<%= t ".text.activation_support", support_url: new_feedback_report_url %>
<%= t ".activation_support.text", support_url: new_feedback_report_url %>

<%= t ".text.faq", faq_url: archive_faqs_url %>
<%= t ".faq.text", faq_url: archive_faqs_url %>
<% end %>
32 changes: 18 additions & 14 deletions config/locales/mailers/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -651,24 +651,28 @@ en:
signups_here: 'Here are the invalid sign-ups:'
subject: "[%{app_name}][%{collection_title}] Invalid sign-ups found"
invitation:
about:
html: The Archive of Our Own (AO3) is a free, noncommercial archive built by and for fans. Our servers are owned by our parent nonprofit, the %{otw_link}, which works to protect fan rights and preserve fanworks. We welcome all kinds of fanworks, including fanfiction, fanart, fanvids, and podfic from any fandom.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In all these strings, please replace "AO3" with the %{app_name} variable and set that to ArchiveConfig.APP_SHORT_NAME instead of using AO3 directly (refer the general i18n guidelines). Same goes for the longform Archive of Our Own, it should be using a variable that is set to ArchiveConfig.APP_NAME

otw_link_text: Organization for Transformative Works
text: The Archive of Our Own (AO3) is a free, noncommercial archive built by and for fans. Our servers are owned by our parent nonprofit, the Organization for Transformative Works (%{otw_url}), which works to protect fan rights and preserve fanworks. We welcome all kinds of fanworks, including fanfiction, fanart, fanvids, and podfic from any fandom.
activation_support:
html: After you sign up, you'll receive an account activation email. If you do not receive this email after 48 hours, please %{support_link}.
support_link_text: contact Support
text: After you sign up, you'll receive an account activation email. If you do not receive this email after 48 hours, please %{support_url}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
text: After you sign up, you'll receive an account activation email. If you do not receive this email after 48 hours, please %{support_url}.
text: 'After you sign up, you''ll receive an account activation email. If you do not receive this email after 48 hours, please contact Support: %{support_url}.'

been_invited: You've been invited to join the Archive of Our Own!
features: With an account, you can post fanworks, use bookmarks to keep track of works you enjoyed, receive subscription emails when your favorite creators or works update, customize the way the site looks for you, and more!
has_invited: "%{user_name} has invited you to join the Archive of Our Own!"
html:
about: The Archive of Our Own (AO3) is a free, noncommercial archive built by and for fans. Our servers are owned by our parent nonprofit, the %{otw_link}, which works to protect fan rights and preserve fanworks. We welcome all kinds of fanworks, including fanfiction, fanart, fanvids, and podfic from any fandom.
activation_support: After you sign up, you'll receive an account activation email. If you do not receive this email after 48 hours, please %{support_link}.
faq: For more information, please check %{faq_link}.
faq:
faq_link_text: our FAQ
html: For more information, please check %{faq_link}.
text: For more information, please check %{faq_url}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the exact text to the new location without modifying it:

Suggested change
text: For more information, please check %{faq_url}.
text: 'For more information, please check our FAQ: %{faq_url}.'

features: With an account, you can post fanworks, use bookmarks to keep track of works you enjoyed, receive subscription emails when your favorite creators or works update, customize the way the site looks for you, and more!
has_invited:
html: "%{user_name} has invited you to join the Archive of Our Own!"
text: "%{user_name} has invited you to join the Archive of Our Own!"
Comment on lines +668 to +670
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is the same text in both emails it can just be one key. If it needs the html suffix to avoid html_safe, make the key has_invited_html instead of giving it variants

join:
html: If you'd like to join us, please %{invitation_link}.
invitation_link_text: follow this link to sign up
join: If you'd like to join us, please %{invitation_link}.
otw_link_text: Organization for Transformative Works
support_link_text: contact Support
text: If you'd like to join us, please follow this link to sign up %{invitation_url}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
text: If you'd like to join us, please follow this link to sign up %{invitation_url}.
text: 'If you''d like to join us, please follow this link to sign up: %{invitation_url}.'

subject: "[%{app_name}] Invitation"
text:
about: The Archive of Our Own (AO3) is a free, noncommercial archive built by and for fans. Our servers are owned by our parent nonprofit, the Organization for Transformative Works (%{otw_url}), which works to protect fan rights and preserve fanworks. We welcome all kinds of fanworks, including fanfiction, fanart, fanvids, and podfic from any fandom.
activation_support: 'After you sign up, you''ll receive an account activation email. If you do not receive this email after 48 hours, please contact Support: %{support_url}.'
faq: 'For more information, please check our FAQ: %{faq_url}.'
join: 'If you''d like to join us, please follow this link to sign up: %{invitation_url}.'
invitation_to_claim:
access:
html: Depending on the archive, your works may have been imported as restricted to registered users only (to keep them out of Google searches). If this is the case, the works will only be accessible by logged-in users unless you choose to make them fully visible. For help unlocking, orphaning, or deleting your works, please %{contact_support_link}.
Expand Down
13 changes: 13 additions & 0 deletions test/mailers/previews/user_mailer_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,19 @@ def invitation_to_claim
UserMailer.invitation_to_claim(invitation.id, archivist.login)
end

# URL: /rails/mailers/user_mailer/invitation
def invitation_by_other_user
inviting_user = create(:user)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please give this user the for_mailer_preview trait.

invitation = create(:invitation, creator: inviting_user)
UserMailer.invitation(invitation.id)
end

# URL: /rails/mailers/user_mailer/invitation
def invitation_by_queue
invitation = create(:invitation)
UserMailer.invitation(invitation.id)
end

# URL: /rails/mailers/user_mailer/invite_request_declined?total=3
def invite_request_declined
user = create(:user, :for_mailer_preview)
Expand Down
Loading