Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send mail notifications about pages if email checkbox is checked. #377

Open
mightydread opened this issue Jan 12, 2016 · 10 comments
Open

Send mail notifications about pages if email checkbox is checked. #377

mightydread opened this issue Jan 12, 2016 · 10 comments

Comments

@mightydread
Copy link

Is there any log when sending emails fails?
These are my settings:

# e.g. smtp
email:
  delivery_method: :smtp
  smtp_settings:
    domain: localhost
    address: smtp.1und1.de
    port: 587
    authentication: :plain
    user_name: XXXX@fango.org
    password: XXXXXX

The setting for smtp I have from my provider

EDIT: users get notifications but it still does not send any emails. Maybe I am missing some packages on debian? Or is it easier to configure a sendmail server and do it like that?

@azul
Copy link
Contributor

azul commented Jan 13, 2016

One good way of testing mail setup is creating a group and sending an invite to an email address you control.
For me the mail arrives and i see

"Sent mail to email@domain.tld"

in the logs (log/production.log inside the crabgrass dir).

If you don't find any such message check below
Groups::InvitesController#create
I'm not sure if it would also log errors. In case you don't see anything I suggest you add logging for the mail sending like this:

# in config/initializers/email.rb around line 7
     # Enable deliveries
     ActionMailer::Base.perform_deliveries = true
    ActionMailer::Base.logger = Rails.logger

In order for this to take effect you might have to start a reload of rails by touching tmp/restart.txt inside the crabgrass folder (if you are using puppet and apache).

We're using sendmail in our production setup but i have no idea how hard it is to setup and maintain. I'd try with smtp for now and see if we can track down the issue.

@mightydread
Copy link
Author

This is the log output when I press notify and send email

Processing by Pages::SharesController#update as JS
  Parameters: {"recipient"=>{"name"=>"[FILTERED]", "access"=>""}, "authenticity_token"=>"[FILTERED]", "add"=>"true", "mode"=>"notify", "page_id"=>"kontakte+4"}
  Rendered pages/shares/_recipient.html.haml (9.9ms)
  Rendered pages/shares/_add_recipient.js.rjs (12.0ms)
Filter chain halted as :add_recipients rendered or redirected
Completed 200 OK in 23.6ms (Views: 14.7ms | ActiveRecord: 0.7ms)
Started PUT "/pages/kontakte+4/share?mode=notify" for 77.5.191.76 at 2016-01-13 05:57:08 -0500
Processing by Pages::SharesController#update as JS
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "recipient_name"=>"[FILTERED]", "recipient"=>{"access"=>""}, "recipients"=>{"mighty"=>"1", ":contributors"=>"0", ":participants"=>"0"}, "notification"=>{"send_email"=>"[FILTERED]", "send_message"=>"dfsdf"}, "notify_button"=>"Schicke Eine Benachrichtigung", "mode"=>"notify", "page_id"=>"kontakte+4"}
Page#update_page_terms (27.5ms)
  Rendered pages/sidebar/_sidebar.html.haml (32.7ms)
  Rendered pages/sidebar/close_popup.js.rjs (35.2ms)
Completed 200 OK in 373.3ms (Views: 38.6ms | ActiveRecord: 246.6ms)

@azul
Copy link
Contributor

azul commented Jan 13, 2016

@mightydread, please try to invite to a group with an email address. It's less complex and will help us narrow down if this is a notification issue or a mail sending issue.

@mightydread
Copy link
Author

It worked like that. So I guess its a notification issue..

@azul
Copy link
Contributor

azul commented Jan 13, 2016

Cool. So we know the email server settings are fine.
Does the user you notify ('mighty') have an email set?
Is the user different from the user you are using to submit the notification?

@mightydread
Copy link
Author

In this particular case no.. But I tried again with a different user.. Same thing:

Processing by Pages::SharesController#update as JS
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "recipient_name"=>"[FILTERED]", "recipient"=>{"access"=>""}, "recipients"=>{"test"=>"1", ":participants"=>"0"}, "notification"=>{"send_email"=>"[FILTERED]", "send_message"=>"adfafs"}, "notify_button"=>"Schicke Eine Benachrichtigung", "mode"=>"notify", "page_id"=>"test+12"}
Page#update_page_terms (5.8ms)
  Rendered pages/sidebar/_sidebar.html.haml (13.2ms)
  Rendered pages/sidebar/close_popup.js.rjs (15.4ms)
Completed 200 OK in 338.1ms (Views: 15.7ms | ActiveRecord: 282.8ms)

EDIT: I mean the user mighty has an email set. But it was not a different user.

@azul
Copy link
Contributor

azul commented Jan 13, 2016

@mightydread I was able to reproduce the issue on our production machine. Will look into it. Thanks for reporting.

@azul azul changed the title Sending mail Send mail notifications about pages if email checkbox is checked. Jan 13, 2016
@mightydread
Copy link
Author

Hi again!
I configured sendmail working on the server now and invitations still work what doesn't work though and hasn't worked before either is the notifications on page changes. Is this related or a different issue? I tried to debug it but weirdly there is nothing happening in the logs.

@elijh
Copy link
Contributor

elijh commented Feb 1, 2016

I am not sure I understand. It has never been the case that you receive automatic notification via email of page changes.

@mightydread
Copy link
Author

I forgot to mention that they are pages I watch... There is a setting in the profie options to enable email notifications. Is that not implemented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants