Commit 63bacd34 authored by Małgorzata Ksionek's avatar Małgorzata Ksionek

Add working email mechanism

Add txt email template

Add some changes to text template

Fix available for welcome email method
parent 48619ab0
......@@ -31,6 +31,6 @@ class DeviseMailerPreview < ActionMailer::Preview
private
def unsaved_user
User.new(name: 'Jane Doe', email: 'jdoe@example.com')
User.new(name: 'Jane Doe', email: 'jdoe@example.com', created_at: 1.minute.ago)
end
end
......@@ -62,7 +62,7 @@ class GroupMember < Member
end
def post_create_hook
if available_for_welcome_email
if available_for_welcome_email?
run_after_commit_or_now { notification_service.new_group_member(self) }
end
......@@ -90,7 +90,7 @@ class GroupMember < Member
super
end
def available_for_welcome_email
def available_for_welcome_email?
true
end
end
......
......@@ -6,7 +6,7 @@
%p
= _('An Enterprise User GitLab account has been created for you by your organization:')
%p
= _('Username: %{username}' % { username: @user.username }
= _('Username: %{username}') % { username: @user.username }
%br
= _('Email: %{email}') % { email: @user.email }
%br
......@@ -15,10 +15,10 @@
%tr
%td.text-content
%p
= _('By authenticating with an account tied to an Enterprise e-mail address, it is understood that this account is an
Enterprise User. To ensure no loss of personal content, an Individual User should create a separate account under
their own personal email address, not tied to the Enterprise email domain or name-space.')
%p
= _('To get started, click the link below to confirm your account.')
%p
= link_to 'Confirm your account', confirmation_link
= _('By authenticating with an account tied to an Enterprise e-mail address, it is understood that this account is an Enterprise User. ')
= _('To ensure no loss of personal content, an Individual User should create a separate account under their own personal email address, not tied to the Enterprise email domain or name-space.')
- unless @user.confirmed?
%p
= _('To get started, click the link below to confirm your account.')
%p
= link_to 'Confirm your account', confirmation_link
<% source_type = member_source.model_name.singular %>
<%= _('You have been granted %{access_level} access to the %{source_name} %{source_type}.') % { access_level: member.human_access, source_name: member_source.human_name, source_type: source_type } %>
<% source_link = member_source.web_url %>
<%= member_source.web_url %>
<%= _('An Enterprise User GitLab account has been created for you by your organization:') %>
<%= _('Username: %{username}') % { username: @user.username } %>
<%= _('Email: %{email}') % { email: @user.email } %>
<%= _('GitLab group: %{source_link}').html_safe % { source_link: source_link } %>
<%= _('If this was a mistake you can leave the %{source_type}.') % { source_type: source_type } %>
<%= polymorphic_url([member_source], leave: 1) %>
<%= _('By authenticating with an account tied to an Enterprise e-mail address, it is understood that this account is an Enterprise User. ') %>
<%= _('To ensure no loss of personal content, an Individual User should create a separate account under their own personal email address, not tied to the Enterprise email domain or name-space.') %>
<%= _('To get started, click the link below to confirm your account.') %>
<%= confirmation_url(@user, confirmation_token: @user.confirmation_token) %>
......@@ -5,6 +5,7 @@ Rails.application.configure do
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = Gitlab::Utils.to_boolean(ENV['CACHE_CLASSES'], default: false)
config.hosts << "gdk.test"
# Show full error reports and disable caching
config.active_record.verbose_query_logs = true
......
......@@ -52,7 +52,7 @@ module EE
end
def new_group_member_with_confirmation_email
Notify.member_access_granted_email_with_confirmation(member.source_type, member.id).message
::Notify.member_access_granted_email_with_confirmation(member.source_type, member.id).message
end
end
......
......@@ -143,9 +143,9 @@ module EE
end
end
override :available_for_welcome_email
def available_for_welcome_email
provisioned_by_this_group?
override :available_for_welcome_email?
def available_for_welcome_email?
!provisioned_by_this_group?
end
def provisioned_by_this_group?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment