blob: 011978ba76ad3cffe236179223517aca84ad1012 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
# frozen_string_literal: true
module Emails
class CreateService < ::Emails::BaseService
def execute(extra_params = {})
skip_confirmation = params.delete(:skip_confirmation)
user.emails.create(params.merge(extra_params)).tap do |email|
email&.confirm if skip_confirmation && current_user.admin?
end
end
end
end
Emails::CreateService.prepend_mod_with('Emails::CreateService')
|