Skip to content

Commit

Permalink
added smtputf8 to header
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Jun 26, 2024
1 parent 47f72ce commit 84e358b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class ApplicationController < ActionController::Base
include Pagy::Backend

prepend_before_action :convert_punycode_params
# prepend_before_action :convert_punycode_params

helper_method :turbo_frame_request?

Expand Down Expand Up @@ -66,11 +66,11 @@ def clear_flash
flash.clear if turbo_frame_request?
end

def convert_punycode_params
return unless email = request.params.dig(:user, :email)
# def convert_punycode_params
# return unless email = request.params.dig(:user, :email)

request.params[:user][:email] = email.split('@').map { |val| SimpleIDN.to_ascii(val) }.join('@')
end
# request.params[:user][:email] = email.split('@').map { |val| SimpleIDN.to_ascii(val) }.join('@')
# end

protected

Expand Down
8 changes: 8 additions & 0 deletions app/mailers/application_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
class ApplicationMailer < ActionMailer::Base
before_action :add_smtputf8_header

default from: Rails.application.config.customization['email_from_address']
layout 'mailer'

private

def add_smtputf8_header
headers['SMTPUTF8'] = 'true'
end
end

0 comments on commit 84e358b

Please sign in to comment.