app/models/user_decorator.rb
# Retrieves and stores the Mailchimp member id
#
# Returns the Mailchimp ID
Retrieves and stores the Mailchimp member id
Returns the Mailchimp ID
Retrieves and stores the Mailchimp member id Returns the Mailchimp ID
def assign_mailchimp_subscriber_id
    begin
      response = gibbon.lists.member_info( { id: Spree::Config[:mailchimp_list_id], emails: [{ email: self.email }] })
      if response[:success] == 1
        member = response[:data][0]
        self.mailchimp_subscriber_id = member[:id]
      end
    rescue Exception => ex
      Exceptional.handle ex
      logger.warn "SpreeMailChimp: Failed to retrieve and store Mailchimp ID: #{ex.message}\n#{ex.backtrace.join("\n")}"
    end
  end
def assign_mailchimp_subscriber_id begin response = gibbon . lists . member_info ( { id : Spree :: Config [ :mailchimp_list_id ] , emails : [ { email : self . email } ] } ) if response [ :success ] == 1 member = response [ :data ] [ 0 ] self . mailchimp_subscriber_id = member [ :id ] end rescue Exception => ex Exceptional . handle ex logger . warn "SpreeMailChimp: Failed to retrieve and store Mailchimp ID: #{ex.message}\n#{ex.backtrace.join("\n")}" end end
Retrieves and stores the Mailchimp member id
Returns the Mailchimp ID
Retrieves and stores the Mailchimp member id Returns the Mailchimp ID