Skip to content

Commit

Permalink
fix email sending (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
usernaimandrey committed Apr 19, 2023
1 parent f8daef4 commit 8698ab0
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion app/services/resume_auto_answer_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ def evaluate_resume(resume)
ActiveRecord::Base.transaction do
user = User.find_by(email: ENV.fetch('EMAIL_SPECIAL_USER'))
attrs = { content: }
Resume::AnswerMutator.create(resume, attrs, user)
@answer = Resume::AnswerMutator.create(resume, attrs, user)
resume.evaluated_ai = true
resume.save!
end
EmailSender.send_new_answer_mail(@answer) if @answer&.persisted?
end

def prepare_resume(resume)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p = sanitize t('.new_comment',
user_path: user_url(@comment.user),
user_path: user_url(@comment.user, locale: I18n.locale),
user: "#{@comment.user.first_name} #{@comment.user.last_name}",
comment_path: resume_url(@comment.resume, anchor: "comment-#{@comment.id}"))
comment_path: resume_url(@comment.resume, anchor: "comment-#{@comment.id}", locale: I18n.locale))
hr

p = t('.content')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p = sanitize t('.new_comment',
user_path: user_url(@comment.user),
user_path: user_url(@comment.user, locale: I18n.locale),
user: "#{@comment.user.first_name} #{@comment.user.last_name}",
comment_path: resume_url(@comment.resume, anchor: "comment-#{@comment.id}"))
comment_path: resume_url(@comment.resume, anchor: "comment-#{@comment.id}", locale: I18n.locale))
hr

p = t('.content')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ h2 = t('.review')
p = sanitize t('.new_answer',
user_path: user_url(@answer.user, locale: I18n.locale),
user: "#{@answer.user.first_name} #{@answer.user.last_name}",
answer_path: resume_url(@answer.resume, anchor: "answer-#{@answer.id}"), locale: I18n.locale)
answer_path: resume_url(@answer.resume, anchor: "answer-#{@answer.id}", locale: I18n.locale))

hr

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ h2 = t('.review')
p = sanitize t('.new_answer',
user_path: user_url(@answer.user, locale: I18n.locale),
user: "#{@answer.user.first_name} #{@answer.user.last_name}",
answer_path: resume_url(@answer.resume, anchor: "answer-#{@answer.id}"), locale: I18n.locale)
answer_path: resume_url(@answer.resume, anchor: "answer-#{@answer.id}", locale: I18n.locale))

hr

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p = sanitize t('.new_comment',
user_path: user_url(@comment.user, locale: I18n.locale),
user: "#{@comment.user.first_name} #{@comment.user.last_name}",
comment_path: resume_url(@comment.resume, anchor: "comment-#{@comment.id}"), locale: I18n.locale)
comment_path: resume_url(@comment.resume, anchor: "comment-#{@comment.id}", locale: I18n.locale))

hr

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
p = sanitize t('.new_comment',
user_path: user_url(@comment.user, locale: I18n.locale),
user: "#{@comment.user.first_name} #{@comment.user.last_name}",
comment_path: resume_url(@comment.resume, anchor: "comment-#{@comment.id}"), locale: I18n.locale)
comment_path: resume_url(@comment.resume, anchor: "comment-#{@comment.id}", locale: I18n.locale))

hr

Expand Down

0 comments on commit 8698ab0

Please sign in to comment.