Skip to content

Commit

Permalink
Merge pull request #438 from debtcollective/od/fix
Browse files Browse the repository at this point in the history
Run subscription charge job once a day, and fix phone number issue on Mailchimp
  • Loading branch information
orlando authored Apr 10, 2021
2 parents 547de0c + 8c5dabf commit 2add9d0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/jobs/subscribe_user_to_newsletter_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def merge_fields(user)
# TODO: validation until we implement a better one on the union widget/membership controller
# Mailchimp fails if the phone number is not valid
phone_number = user.phone_number
if phone_number.length >= 8
if phone_number&.length.to_i >= 7 && phone_number&.length.to_i <= 15
merge_fields_hash[:PHONE] = phone_number
end

Expand Down
4 changes: 2 additions & 2 deletions config/sidekiq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- mailers
:schedule:
find_overdue_subscriptions:
every: '12h'
every: "24h"
queue: default
class: FindOverdueSubscriptionsJob
description: 'This job finds all active overdue subscriptions and creates a sidekiq job to charge the subscriber'
description: "This job finds all active overdue subscriptions and creates a sidekiq job to charge the subscriber"
1 change: 0 additions & 1 deletion cypress/integration/membership.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ describe('Membership Spec', () => {
cy.get("input[name='last-name']").type(faker.name.lastName())
cy.get("input[name='email']").type(faker.internet.email())
cy.get("input[name='phone-number']").type(faker.phone.phoneNumber())
cy.get("select[name='chapter']").select('none')

cy.getWithinIframe('[name="cardnumber"]').type('4242424242424242')
cy.getWithinIframe('[name="exp-date"]').type('1232')
Expand Down

0 comments on commit 2add9d0

Please sign in to comment.