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

Spam webhook #147

Merged
merged 2 commits into from
Mar 17, 2015
Merged

Spam webhook #147

merged 2 commits into from
Mar 17, 2015

Conversation

cdale77
Copy link
Contributor

@cdale77 cdale77 commented Mar 17, 2015

Fixes issues 138 and 139 by adding a service object to deal with both spam reports and bounce events from SendGrid, via webhooks

if event[:email].present? && HANDLED_EVENTS.include?(event[:event])
user = User.find_by(email: event[:email])
method_name = "process_#{event[:event]}_event".to_sym
self.send(method_name, user) if user

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant self detected.


context "when one of our mailing list emails is marked as spam" do
let!(:list_user) do create(:user, email: "listemail@example.com",
password: nil,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align the elements of a hash literal if they span more than one line.

@gkop
Copy link
Member

gkop commented Mar 17, 2015

+1

end

context "when one of our mailing list emails is marked as spam" do
let!(:list_user) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using {...} for multi-line blocks.

cdale77 added a commit that referenced this pull request Mar 17, 2015
@cdale77 cdale77 merged commit 10c272c into master Mar 17, 2015
@cdale77 cdale77 deleted the spam-webhook branch March 17, 2015 16:15
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

Successfully merging this pull request may close these issues.

3 participants