Membership system

by Gisle Hannemyr

This is the main design document for HNM Member. This is a Drupal-based system to manage memberships.

Table of contents

Drupal projects discussed in this chapter: Commerce Core, Commerce Vipps, User CSV Import, Webform.

Introduction

The membership system shall provide the essential functions for an organization to manage its member base and provide services, such a newsletters and other means of communication to its members.

There are three specific use cases that shall be used as the target and who shall be invited to evaluate the UX and functionality:

HNM member functionality is designed to have some of the same functionality as the non-free Zubarus membership system. However, HNM member shall be a distribution based upon contributed and custom Drupal modules. Its five components are (links go to the same components in Zubarus):

  1. Membership profile (My page).
  2. Membership management (Member registry).
  3. Invoicing (Invoicing membership dues).
  4. Payment monitoring (Payment monitoring).
  5. Communication (Communication).

Limitation: Initial version will not integrate with payment gateways (such as Vipps). Currently the cost of integrating into a payment gateway is too high. The payment monitoring part will send out email invoices, SMS reminders, and also track payment, but the treasurer need to enter payment details manually. There will be no link to a payment processor's OCR service.

We are currently aware of the following web pages describing membership management :

The list is included in this introduction to show the type of functionality and services than is typically provided by a membership system.

Typical requirements also from this Drupal.org support forum post: Membership module recommendations.

Links to search for "Membership management":

Other documentation:

Use of Drupal projects

Those projects listed below are planned for the Drupal 9 version. Project health need to be investigated and indicated for those I do not maintain myself. Those tagged "OK" are know to be in good shape.

General

Membership profile and management

Invoicing and payment

Used:

For consideration:

Project evaluated, but rejected or postponed:

To have a Commerce Vipps or any other payment processor probably requires Commerce dependencies. Dropped from inital release for cost reasons.

Communication

Status

Drupal 7 is only supported until November 2022. The Drupal 7 version has been shelved. A fresh start based upon Drupal 9 components is needed for a 2022 release.

Membership system components

The project's five components are:

  1. Membership profile.
  2. Membership management.
  3. Invoicing.
  4. Payment monitoring.
  5. Communication.

There are notes about deployment of various Drupal contributed projects below. They were created for the Drupal 7 version of HNM member. They need to be replaced for the Drupal 9 version. However, we're keeping them until suitable Drupal 9 replacements have been found.

The proposed schema for these components can be found below in a section about Fields.

Membership profile

Each member can access their own page ("My page") with the status and history of their membership, including payment history. From their profile page, members can also maintain their own contact information.

Login to "My page" is done by logging in on organization's the membership website using personal credentials. The site is adapted to each individual organization's needs, and some development work must be expected. Information displayed on "My page" is:

The password is not displayed, but there is a field that allows a logged-in member to change the password.

Unless indicated, the information in the membership profile can only be edited by a membership administrator.

Membership management

The membership system has the following components:

Members may be imported using User Import (no Drupal 9 version yet, but HNM is maintaning it, and we plan to do the upgrade).

Invoicing

The membership system generates invoices for membership dues according to the member's mebership plan. Invoices can be sent automatically, or initiated by the treasurer.

Two sending options are provided:

Using HNM membership to send ordinary mail is free. Sending an SMS is by means using an external metered service, and will be charged. As a reminder, all non-free services will be marked with the symbol "($$$)".

Invoice (contributed module)

The Drupal 7 version used the Invoice project. This is not ported to Drupal 9. We're keeping the notes about the Drupal 7 version until wde're able to find a replacement (or upgrade it ourselves).

  1. Manually download dompdf_0.6-beta2.tar.gz from the project author and place it in the project's root directory.
  2. Change locale into nb_NO.utf8. (This changes the currenct from “$” to “kr”.)
  3. Change date format into Y-m-d.
  4. Change default VAT percentage into 25 or 0 (for an organization that does not charge VAT for membership dues).

This project uses an outdated version of the dompdf library: 0.6-beta2. Latest stable version on GitHub is 0.8.3. However, it works fine, and seems to handle Norwegian characters.

Creating new templates for Invoice:

The subdirectory templates contain invoice templates. The project comes with a single template named “default”. To create a new template named “example”, do:

  1. Copy the three files replacing “default” in the file name with “example”.
  2. In example.inc change the name of the function
    _invoice_default_get_template_output() to
    _invoice_example_get_template_output().
  3. In example.inc change the string assigned to $footer_content (line 31).
  4. In example.inc change default_logo.inc to example_logo.inc.
  5. In example.css set the values for width and height for the #invoice-supplier-logo to the desired values.

Note on payment processors

Stripe, PayPal, or Vipps has been considered as payment processors. Links to pages giving information about transaction costs below:

So far, we're only tried to establish a relationship with Vipps. Log of our contact with Vipps:

However, Vipps checkout is being developed, and shall have a lower cost. It integrates with WooCommerce, which does has no Drupal bridge project.

There exists a Drupal bridge module called Commerce Vipps (8.x-4.0-beta4) that has Commerce as a dependency.

Commerce is huge, complex, and buggy. Not ideal for this project. Postpone supporting payment until much later.

Notes on installing Commerce Vipps:

Do not enable anyting using Drush, as the project depends on Composer Manager, Using drush creates directories that can't be written by the web server.

  1. Download Composer Manager.
  2. Enable Composer Manager using the GUI.
  3. Download Commmerce Vipps.
  4. Use drush to enable: drush en commerce_vipps -y.
  5. Go to sites/all/vendor. Make it writable by the web server.
  6. Make sure sites/default/files/composer is writable by the web server.
  7. Check that that all dependencies are listed by Composer Manager.

After installing, navigate to Store » Configuration to set up things:

Payment monitoring

The trasurer needs to monitor payments manually, and when money is received, record the payment in the membership system. The system can be configured to send the following reminders automatically:

The reasurer van get a list of all payments due. Option to remind by emsail and/or SMS ($$$), or to print the invoice for physical delivert .

Communication

This functional unit lets the administrator set up means to communicate with the members or owners.

Newsletter

GUI created content type (make it a Features export?)

Notify settings:

Mailchimp

See this chapter for setting up an RSS feed for Mailchimp.

Condider using the Mailchimp module for syncing users. It is not required for sending out newsletters if the subscriber list is not maintained by Drupal.

See alsoSee DO: Drupal modules that may violate the GDPR for information about Mailchimp and GDPR-compliance. In addition: Kromann Reumeert: Datatilsynet i Bayern griber ind mod brugen af Mailchimp. UiO: Bruk av Mailchimp til nyhetsbrev. You also want to read these two articles on the Mailchimp website: Mailchimp Data Security and Privacy, Mailchimp and European Data Transfers.

Notice om Mailchimp web:

If you would like to sign and execute a copy of the SCCs with Mailchimp, you can do so by making your request at legal@mailchimp.com with your account name, username, and/or email address associated with your username.

Vocabulary and fields

The system requires one taxonomy vocabulary and several fields to be created by means of the GUI when setting up a site. Some of these names are used by the business logic and cannot be changed. The tag “[fixed]” are attached to those. There should be a sanity check for those. Those that are “[fixed]” should live in code when things are stable.

Vocabulary: Registration types

The registration types are the types of membership or types of co-op ownership that exists on the site. It is implemented as a taxonomy vocabulary.

  1. Machine name: regtype [fixed].
  2. Human name: Medlemstype.
  3. Description: De medlemstyper som finnes i foreningen.

By default these six registration types exist. The three letter code is the machine name- All these codes are [fixed].

  1. Member ORD (ordinary member)
  2. Family1 FM1 (primary membership)
  3. Family2 FM2 (secondary membership, free or discounted)
  4. Trial TRI (time-limited trial membership)
  5. Special SPC (price is in a field a part of member object, e.g. for honorary members).
  6. Not-member NUL

Each registration type term has the following fields. The machine names for these fields are used in the business logic of the module, and is [fixed]. They are all required (except the bools, as they work differently):

For instance: To configure a honorary member as a registration type, set price to zero, and frequency to never (but frequency does not matter). To configure a life time membership costing kr. 9000 as a registration type, set price to 9000, and frequency to permanent. These can also be set up by other means if there is a “Special” registration type-

These are the values for vvnf:

  code description                         | price | freq. | W. | si  | conv. | sel
- E:   Enslig (ordinært medlemskap)        |   400 | År    | 10 | Nei | NUL   | Ja
- FM:   Familiemedlemsskap. (primærmedlem) |   600 | År    | 10 | Nei | NUL   | Ja
- FM2: Familie. Sekundær (faktureres ikke) |     0 | Aldri | 10 | Nei | NUL   | Nei
- UNG: Under 27 år                         |   150 | År    | 10 | Nei | NUL   | Ja
- UTP: Ufør, pensjonist                    |   300 | År    | 10 | Nei | NUL   | Ja
- PR:  Prøvemedlem                         |   400 | År    | 10 | Ja  | NUL   | Nei
- NUL: Ikke-medlem                         |     0 | Aldri | 10 | Nei | NUL   | Nei

Expiry

There are three use cases for an registration expiring:

  1. Trials: Signups are offered 30 days free membership. Manually converted to another type by treasurer upon payment. Automatically converted to NUL after 30 days.
  2. Discounts: Reduced fee membership until end of year, then automaticaly converted.
  3. Ordinary: Expires at end of year.

Trials: Set global variable for time in days when a trial membership (e.g. 30), a date us computed and stored as part of signup. expires. Manual conversion from trial to another type wheb treasurer register payment.

DESCRIBE WORKFLOW FOR JOINING AND QUITTING.

Currency is determined by the locale set in Invoice configuration. See also: Språkkoder for POSIX locale i Norge; IETF: RFC 3066; Wikipedia: ISO 4217.

This can be changed by the admin.

These has to be set up by an administrator for each client. Each organization has its own set of registration types, and cannot assume anything about what they are.

Fields: Profile

The user entity may be a physical person or a corporate user. The user profile has the following attributes. Those marked “[A]” should only be accessable to the administrator.

SNP webform

SNP uses a webform for membership applications. It has the following fields:

The starred items are required.

The form also let more than one person living on the same address register on one form.

VVNF fields

To inspect the user profile, use this:

$user_fields = user_load(1);
dpm($user_fields, '$user_fields');

These fields are curently defined for VVNF user profile (“[D]” is defined by Drupal). First column is current name. Second column is canonical name. Third column is datetype.

uid [D]
name [D]
pass [D]
mail [D]
timezone [D]
field_etternavn          field_lastname      (text)
field_fornavn            field_firstnames    (text)
field_gateadresse        field_address1      (text)
field_adressetillegg     field_address2      (text)
field_husstandsmedlemmer field_family        (text)
field_postnummer         field_postcode      (text)
field_poststed           field_place         (text)
field_land               field_country       (text)
field_kjonn              field_gender        (text)
field_mobil              field_mobile        (phonefield)
field_akseptvedtekter    field_accstatutes   (bool)
field_akseptgdpr         field_accgdpr       (bool)
field_infomail           field_infomail      (bool)
field_specialprice       field_specialprice  (int)
field_spexpiry           field_spexpiry      (date)
field_msexpiry           field_msexpiry      (date)
field_onetimesent        field_onetimesent   (bool)
field_medlemsnummer      field_regnumber     (text)
field_mid                field_mid           (int)
field_anneninfo          field_auxinfo       (long text)
field_medlemstype        field_regtype       (term reference)
field_fodselsdato        field_birthdate     (date)
field_konvtil            field_convto        (text)

To fix this, it is enough to use this form in the Drupal 7 API:

db_rename_table('field_etternavn', 'field_lastname');

It renames the field, but the old name stils stays around in these tables: ctools_object_cache field_config - rename? field_config_instance - rename field_revision_field_firstnames - value and format is legacy

Fields can be added, removed and changed by means of the administrative GUI.

Common fields for all types of sites
  1. field_lastname - cannot be empty.
    Etternavn: Kun ett etternavn, men det kan inneholde bindestrek.
  2. field_firstnames - may be empty for corporate
    Fornavn: Du kan oppgi mer enn ett fornavn (mellomnavn) adskilt med blanke eller med bindestrek.
  3. field_birthdate - empty for corporate.
    Fødselsdato: Bruk nedtrekksmenyen til å angi en fødselsdato.
  4. field_mobile
    Mobilnummer: Mobilnummeret kan benyttes i stedet for brukernavnet ved pålogging.
  5. field_workphone Jobbtelefon: Oppgi jobbtelefon dersom nummeret ikke er det samme som allerede oppgitt for mobiltelefon.
  6. field_address1
    Adresselinje1: Tekst til første adresselinje (typisk gateadresse eller eiendomsnavn).
  7. field_address2
    Adresselinje2: Tekst til andre adresselinje.
  8. field_postcode
    Postnummer: Oppgi postnummer for din adresse.
  9. field_place
    Poststed: Oppgi poststedet der du bor.
  10. field_country
    Land: Oppgi hvilket land du er bosatt i.
  11. field_onetimesent
    Påloggingslenke sendt: Krysset indikerer at dette medlemmet har fått tilsendt en påloggingslenke for pålogging en gang. Fjern krysset dersom du vil inkludere medlemmet i neste masse-utsendelse av slike lenker.

Fields for membership site

  1. field_gender
    Kjønn: Angi om du er kvinne ellermann.
  2. field_accstatutes
    Jeg har lest og aksepterer foreningens vedtekter: Kryss av for at du aksepterer foreningens vedtekter.
  3. field_accgdpr
    Jeg samtykker til behandling av mine personopplysninger: Kryss av for å gi til kjenne at du samtykker i at foreningen behandler mine personopplysninger som framgår av skjemaet. Formålet med behandlingen er å føre et medlemsregister.
  4. field_infomail
    Jeg ønsker informasjon pr. e-post: Kryss av hvis du ønsker å få tilsendt informasjon pr. e-post.
  5. field_infosms
    Jeg ønsker informasjon pr. SMS: Kryss av dersom du ønsker å få tilsendt informasjon pr. SMS.
  6. field_membersince
    Medlem siden: Dato når medlemsskapet ble opprettet.
  7. field_msexpiry
    Tidspunkt for fornyelse: Det tidspunkt medlemsskapet skal fornyes.
  8. field_regtype
    Medlemstype: Angi type medlemsskap.
  9. field_auxinfo
    Annen informasjon: I dette feltet kan medlemsadministrator legge inn annen informasjon om medlemmet. Informasjonen er ikke synlig for andre enn administratorer.

Fields for housing co-ops

  1. field_sectionno - seksjonsnummer (= enhetsnr) - en eier kan inneha multiple seksjoner.
    NB: Change machine name to field_seksjonsnummer
    Seksjonsnummer: Oppgi et nummer (heltall) som identifiser eierseksjonen (leiligheten).
  2. field_pplaceno
    P-plass: Oppgi et nummer (heltall) som identifiserer parkeringsplassen.
  3. field_unitid - leilighetsnummer - en eier kan ha multiple - tom for næring og garasje)
    Bolignummer: Oppgi offisielt bolignummer (H0000).
  4. field_unitaddress
    Enhetsadresse: Velg den oppgangen leiligheten du eier ligger i. Dersom du kun har parkeringsplass velger du «Grønlandsleiret 61 (kjeller)».

Enhetsadresse (field_unitaddress) is realised using the a drop-down menu with all possible options spelled out. Example:

Grønlandsleiret 61 A|Grønlandsleiret 61 A
Grønlandsleiret 61 B|Grønlandsleiret 61 B
Grønlandsleiret 61 C|Grønlandsleiret 61 C
Grønlandsleiret 61 (kjeller)|Grønlandsleiret 61 (kjeller).

The following fields from the spreadsheet is not imported as they are the same for all records:

  1. Enhetspoststed (0190 Oslo)
  2. Bygningsnr (1)
  3. Bygningsnavn (Grønlandsleiret 61)

Zubarus member registry

Zubarus har stor fleksibilitet i kategorisering og prising av medlemskap, og kan derfor enkelt tilpasses alle typer organisasjoner.

«Kategorisering: Det er en svært fleksibel struktur for kategorisering av medlemskap. Dere kan legge opp til forhåndsdefinerte rabattkategorier eller helt individuell prising og ha forskjellige medlemskapsperioder, f.eks. livstidsmedlemskap eller prøvemedlemskap ved vervekampanjer.

Medlemsdata: Dere kan foreta registrering og vedlikehold av medlems- og adresseinformasjon, enten sentralt eller fra lokallag eller avdelinger.
Nye medlemmer kan melde seg inn via innmeldingsskjema eller via SMS-innmelding. Den enkleste implementasjonen er å ta i bruk et standard innmeldingsskjema vi har, som vi styler etter deres farger og form. Vi tilbyr også web-service dersom man ønsker å ha skjema helt integrert på sin side. Mange medlemmer har en annen betaler, det kan være forelder, besteforelder, kommune eller arbeidsgiver – det er ingen problem.

Verving: Vervekampanjer med kampanjekoder som gir rabatterte kontingenter for alle eller utvalgte medlemskategorier. Ved utløp av første periode fornyes medlemskapet til ordinær pris.
Medlemmer som verver kan få vervepremier, provisjon eller redusert pris på eget medlemskap.»

Translation

Translating fields

The fields that is used for the Configuration » People » Account settings » Manage fields are listed below.

The list show machine name and any restrictions enforced by HNM Member, followed by the Norwegian translation of the title and descripton.

The field names are hardcoded in PHP, so it is important for them to be consistent across platforms.

Fields stored in the core {users] table

  1. uid
  2. name
  3. mail

Translating User Import

We're using a dev-version of User Import, so some strings must be translated locally.

  1. Character Encoding
    Tegnsett
  2. Domain for nomail
    Domene for brukere uten epost
  3. Users without a valid email-address can be given a pseudo-email in this domain in the CSV-file.
    Brukere uten en gyldig epost-adresse kan oppføres med en pseudo-epost i dette domenet i CSV-fila.

Translating Invoice

Organization name   Organisasjonsnavn
Street              Gateadresse
Zipcode             Postnummer
Town                Poststed
State or county     Fylke
Country             Land
Phone               Telefon-nummer
Email               Epost-adresse
Web address         Nettsted-URL
Organization number Organisasjonsnummer
VAT number          MVA-nummer
If you want to add an invoice, use this content type.
  Dersom du ønsker å lage en faktura, kan du bruke denne innholdstypen.

Translating notify

We're presenting Notify as a newsletter module, so we need to use some custom translations to play down the notification aspect. Currently, the following six are used:

  1. Notification settings
    Nyhetsbrev-innstillinger
  2. email notification settings
    Innstillinger for nyhetsbrev
  3. Notify status
    Status for nyhetsbrev
  4. Notification default for new users
    Standardinnstilling for abonnement for nye brukere
  5. Receive email notifications
    Motta nyhetsbrev på epost
  6. Subscribe all non-blocked users that do not already subscribe to notifications.
    Opprett abonnement for alle ikke-blokkerte brukere som ikke allerede abonnerer på nyhetsbrevet.

To protect these from being overwritten, make sure that under “Import behaviour” the radiobutton “Don't overwrite existing translations” is selected.

Translations not pushed to server because Notify 2.6 is yet not released (???).

  1. These are the initial settings that apply to new users, and to users that become subscribed by means of the automatic subscription checkboxes under the “Users” tab.
    Dette er startinnstillingene som settes for nye brukere, og for brukere som blir abonnementer ved bruk av avkrysningsbokser under fanen «Brukere».
  2. These settings will only be effective if the master switch is set to “Enabled”.
    Disse innstillingene vil bare bli benyttet dersom hovedbryteren er satt til «Aktivert».
  3. Automatic subscription checkboxes
    Avkrysningsbokser for automatisk abonnement
  4. Subscribe users when importing
    Opprett abonnement når brukere importeres
  5. Subscribe all users now
    Opprett abonnement for alle brukere nå
  6. Press “Save settings” if you have changed setting for automatic subscription.
    Trykk på «Lagre innstillinger» dersom du har endret innstillingene for automatisk abonnement.
  7. You may check/uncheck the checkboxes and the “How much”-selection to change the users' subscriptions. Press “Save settings” to save the changes.
    Du kan endre avkryssingen og hva som er valgt under «Hvor mye» for å endre abonnementet til en bruker. Trykk på «Lagre innstillinger» for å lagre endringene.
  8. The following table shows all users that are subscribed:
    Denne tabellen viser alle brukere som abonnerer:
  9. Subscribe users that are imported by means of User Import (and similiar tools).
    Opprett abonnement for brukere som importeres ved hjelp av User Import (og lignende verktøy).

Deployment

HNM Members must be individually deployed for each client. This describes the steps.

  1. Install Drupal 7 using drupal_cleaninst.sh.
  2. Enable Locale (core).
  3. Set site name, e.g.: “Medlems-demo”.
  4. Set regional settings: Norway, Monday, Europe/Oslo. Do not let users sett their own TZ.
  5. Change settings for date and time to ISO.
  6. Set private file system path, e.g.: /var/private/medlemsweb.
  7. Enable phonefield.
  8. Add field “Mobile” of type “Phonefield” to user profile, translate. Make display label “Inline” and format “Phone number”.
  9. Add fields for first names and last name as text fields, translate.
  10. Install the required projects and enable all non-core modules.
  11. Deactivate profile images (Checkbox on Configuration » People » Account settings).
  12. Enable phone field for Flexi Login.

If it is a membership system:

  1. Add field “regtype” as “Term reference” to allow radio buttons. Values are defined above (see Vocabulary: Registration types).

If invoicing is part of system, also do the following (release 3):

  1. Configure Invoice with Norwegian defaults.
  2. Add “API root name” to Invoice configuration.
  3. Create invoice template for client.
  4. Change display settings for user profile for field named “Email” to “Hidden” (it comes from Mime Mail).
  5. Uncheck “Administrators shall be notified about unpublished content of tracked types”.
  6. Check “Subscribe users that are imported by means of User Import (and similiar tools)”.

Make ready for production:

  1. Create role for site and member admin (e.g. “Editor” or “Member admin”) and assign the role to the appropriate user.
  2. Establish Secret word and change login settings.

Install local translations:

  1. Flexilogin-7.x-1.x.nb.po
  2. Invoice-7.x-1.x.nb.po (release 3)

Permissions

Permissions for anonymous if site is open to public:

  1. Comment: View
  2. Filter: Filtered HTML
  3. Node: View published
  4. Notify: access

Otherwise, withdraw right to see published nodes and assin the above to authenticated.

Permissions for authenicated:

  1. Comment: View, Post, Skip
  2. Filter: Filtered HTML
  3. Mime Mail: Edit user settings
  4. Node: View published
  5. Notify: access

Permissions for member admin:

  1. Advanced Help: all.
  2. Field Permissions: Administer field permissions, Access other users' private fields, all 5 for custom
  3. Invoice: All
  4. Node, Newsletter article: all
  5. System: admin theme.
  6. Toolbar: use.
  7. User: administer users.
  8. User Import: both.

Final word

The current system based upon Drupal 7 is shelved. Development of HNM member for Drupal 9 will start in April 2022, and should be ready by August 2022.


Last update: 2022-01-20 [gh].