diff options
Diffstat (limited to 'app/mailers/emails')
-rw-r--r-- | app/mailers/emails/groups.rb | 19 | ||||
-rw-r--r-- | app/mailers/emails/notes.rb | 12 | ||||
-rw-r--r-- | app/mailers/emails/profile.rb | 10 |
3 files changed, 41 insertions, 0 deletions
diff --git a/app/mailers/emails/groups.rb b/app/mailers/emails/groups.rb new file mode 100644 index 00000000000..07812a01202 --- /dev/null +++ b/app/mailers/emails/groups.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Emails + module Groups + def group_was_exported_email(current_user, group) + group_email(current_user, group, _('Group was exported')) + end + + def group_was_not_exported_email(current_user, group, errors) + group_email(current_user, group, _('Group export error'), errors: errors) + end + + def group_email(current_user, group, subj, errors: nil) + @group = group + @errors = errors + mail(to: current_user.notification_email_for(@group), subject: subject(subj)) + end + end +end diff --git a/app/mailers/emails/notes.rb b/app/mailers/emails/notes.rb index 6dd4ccb510a..4b56ff60f09 100644 --- a/app/mailers/emails/notes.rb +++ b/app/mailers/emails/notes.rb @@ -40,6 +40,18 @@ module Emails mail_answer_note_thread(@snippet, @note, note_thread_options(recipient_id, reason)) end + def note_design_email(recipient_id, note_id, reason = nil) + setup_note_mail(note_id, recipient_id) + + design = @note.noteable + @target_url = ::Gitlab::Routing.url_helpers.designs_project_issue_url( + @note.resource_parent, + design.issue, + note_target_url_query_params.merge(vueroute: design.filename) + ) + mail_answer_note_thread(design, @note, note_thread_options(recipient_id, reason)) + end + private def note_target_url_options diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb index 441439444d5..4b19149a833 100644 --- a/app/mailers/emails/profile.rb +++ b/app/mailers/emails/profile.rb @@ -44,6 +44,16 @@ module Emails mail(to: @user.notification_email, subject: subject(_("Your Personal Access Tokens will expire in %{days_to_expire} days or less") % { days_to_expire: @days_to_expire })) end end + + def unknown_sign_in_email(user, ip) + @user = user + @ip = ip + @target_url = edit_profile_password_url + + Gitlab::I18n.with_locale(@user.preferred_language) do + mail(to: @user.notification_email, subject: subject(_("Unknown sign-in from new location"))) + end + end end end |