#263 new
John Chase

Can't comment on lead with other user comments

Reported by John Chase | March 8th, 2013 @ 06:32 PM | in 0.9.10 "Alekhine"

When posting a comment on a lead, which has already been commented on by another user; the follow error appears and the comment cannot be saved.

Processing by CommentsController#create as JS
Parameters: {"utf8"=>"✓", "authenticity_token"=>"I/RgKNIjy4I7tDYABe1w9W4sXvgVLvNUli00OThUIQ8=", "comment"=>{"commentable_id"=>"4", "commentable_type"=>"Lead", "comment"=>"test"}, "commit"=>"Add Note"} Rendered subscription_mailer/comment_notification.text.erb (1.0ms)

Sent mail to myemail@domain.com (1402ms)
Completed 500 Internal Server Error in 1463ms

Net::SMTPFatalError (555 5.5.2 Syntax error. kt5sm7721822pbc.30 - gsmtp
): app/models/polymorphic/comment.rb:63:in block in notify_subscribers' app/models/polymorphic/comment.rb:59:ineach' app/models/polymorphic/comment.rb:59:in notify_subscribers' app/controllers/comments_controller.rb:90:increate'

Rendered /var/lib/gems/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.7ms) Rendered /var/lib/gems/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.6ms) Rendered /var/lib/gems/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (97.8ms)

Comments and changes to this ticket

  • Thomas

    Thomas March 23rd, 2013 @ 07:47 AM

    Same problem here.
    I don't speak ruby, but based on John's report, I commented out one line in app/models/polymorphic/comment.rb, see below.
    Now it works.
    Obviously, FFCRM tried to send a notification about the new comment to the first user who left a comment, and this didn't work. Probably due to a misconfiguration of the email settings.
    It would be a good idea to check the settings in FFCRM and display an error message in case of mistakes.

    # Notify subscribed users when a comment is added, unless user created this comment def notify_subscribers commentable.subscribed_users.reject{|user_id| user_id == user.id}.each do |subscriber_id| if subscriber = User.find_by_id(subscriber_id) # Only send email if SMTP settings are configured if Rails.application.config.action_mailer.smtp_settings.present?

    SubscriptionMailer.comment_notification(subscriber, self).deliver <--- commented out here, just to make it work

        end
      end
    end
    

    end

  • Thomas

    Thomas March 23rd, 2013 @ 07:52 AM

    Sorry, I wasn't aware that '#' is used to define captions here.
    One more try.

      # Notify subscribed users when a comment is added, unless user created this comment
      def notify_subscribers
        commentable.subscribed_users.reject{|user_id| user_id == user.id}.each do |subscriber_id|
          if subscriber = User.find_by_id(subscriber_id)
            # Only send email if SMTP settings are configured
            if Rails.application.config.action_mailer.smtp_settings.present?
    #          SubscriptionMailer.comment_notification(subscriber, self).deliver
            end
          end
        end
      end
    
  • Thomas

    Thomas March 23rd, 2013 @ 09:18 AM

    Works alright after I corrected my email settings in settings.yml for comments.

  • John Chase

    John Chase March 23rd, 2013 @ 10:16 AM

    Thanks for the reply. +1

    I did get this working by removing the < / > from the subject line. See below.

    git diff app/mailers/subscription_mailer.rb
    diff --git a/app/mailers/subscription_mailer.rb b/app/mailers/subscription_mailer.rb
    index 96260e4..a79f58f 100644
    --- a/app/mailers/subscription_mailer.rb +++ b/app/mailers/subscription_mailer.rb @@ -31,7 +31,7 @@ class SubscriptionMailer < ActionMailer::Base

     mail :subject => subject,
          :to => user.email,
    
    • :from => "#{@user.full_name} <#{Setting.email_comment_replies[:address]}>",
    • :from => "#{@user.full_name} #{Setting.email_comment_replies[:address]}", :date => Time.now end end

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Ruby on Rails CRM platform for Web 2.0 and beyond

People watching this ticket

Pages