From 3de4d313a353e2133da5adc9140ce939e76eed94 Mon Sep 17 00:00:00 2001 From: Haunui Saint-sevin Date: Tue, 4 Jun 2019 00:49:20 +0000 Subject: Remove html tag from the text part of email Instead of calling single function emitting HTML tags in the HTML part of email, directly output HTML tags or raw text. --- app/views/notify/new_user_email.html.haml | 3 ++- app/views/notify/new_user_email.text.erb | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'app/views/notify') diff --git a/app/views/notify/new_user_email.html.haml b/app/views/notify/new_user_email.html.haml index dfbb5c75bd3..ec135ae994f 100644 --- a/app/views/notify/new_user_email.html.haml +++ b/app/views/notify/new_user_email.html.haml @@ -13,4 +13,5 @@ %p = link_to "Click here to set your password", edit_password_url(@user, reset_password_token: @token) %p - = raw reset_token_expire_message + This link is valid for #{password_reset_token_valid_time}. + After it expires, you can #{link_to("request a new one", new_user_password_url(user_email: @user.email))}. diff --git a/app/views/notify/new_user_email.text.erb b/app/views/notify/new_user_email.text.erb index f3f20f3bfba..d5aba21b8b7 100644 --- a/app/views/notify/new_user_email.text.erb +++ b/app/views/notify/new_user_email.text.erb @@ -4,7 +4,9 @@ The Administrator created an account for you. Now you are a member of the compan login.................. <%= @user.email %> <% if @user.created_by_id %> - <%= link_to "Click here to set your password", edit_password_url(@user, :reset_password_token => @token) %> +Click here to set your password: +<%= edit_password_url(@user, :reset_password_token => @token) %> - <%= reset_token_expire_message %> +This link is valid for <%= password_reset_token_valid_time %>. After it expires, you can request a new one here: +<%= new_user_password_url(user_email: @user.email) %> <% end %> -- cgit v1.2.3 From 1475206bcccb12c14ed4b230af66a56b7f11e4df Mon Sep 17 00:00:00 2001 From: Haunui Saint-sevin Date: Tue, 4 Jun 2019 00:50:41 +0000 Subject: Sync text part of email with the HTML part The text part was missing the condition to change the first message. Borrow the code from the HTML part. --- app/views/notify/new_user_email.text.erb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/views/notify') diff --git a/app/views/notify/new_user_email.text.erb b/app/views/notify/new_user_email.text.erb index d5aba21b8b7..7e0db75472d 100644 --- a/app/views/notify/new_user_email.text.erb +++ b/app/views/notify/new_user_email.text.erb @@ -1,8 +1,13 @@ Hi <%= sanitize_name(@user.name) %>! +<% if Gitlab::CurrentSettings.allow_signup? %> +Your account has been created successfully. +<% else %> The Administrator created an account for you. Now you are a member of the company GitLab application. +<% end %> login.................. <%= @user.email %> + <% if @user.created_by_id %> Click here to set your password: <%= edit_password_url(@user, :reset_password_token => @token) %> -- cgit v1.2.3