I'm trying to configure printing of a membership card directly from Civi using a custom mailing label format. Here's what I've done so far:

  1. Created a custom label format with the parameters for Avery Label 5371 (business card)
  2. Tried to get the data to print as a mailing label on the card stock (which is pre-printed with the org logo) by creating a message template using tokens for member name, membership expiration date, and membership type (Membership Card Data).
  3. From member search results, performed the action "Create Mailing Label" and selected the custom label format I created in step 1.
  4. Result is a nicely printed list with the name and address of each person, not the information specified in Membership Card Data.

I am guessing that the custom label format controls the size and number of each entry on a page, and the Membership Card Data message template is ignored and replaced by the specs in Localization>Address Settings/Mailing Label. I can't find anywhere to add a new mailing label format that contains the tokens I need for membership cards.

I've combed the boards and have seen discussions, but none seem to address my particular problem. Any thoughts?

  • I have the same requirement i.e. printing membership cards as labels inc. membership type and membership end date. Can't see how to do it
    – user3201
    Commented Apr 21, 2016 at 20:53

3 Answers 3


I ended up creating an extension for a professional organization to handle this - ingredients:

  1. function membershipcards_civicrm_tokenValues [you must create the tokens e.g. $value['membership.type'] and $value['membership.status'] - I have 'see Example from Lobo' in my NOTES: https://civicrm.org/node/480

  2. Then I have a Task: class CRM_membershipcards_Task_IssueMembershipCards extends CRM_Contact_Form_Task { So that you can Find -> Advanced Search Contacts -> select them and then in the -actions- you can pick: Print Membership Cards

  3. Then in the postProcess for that -action- I swap out the tokens and I re-use much of core mailing label bits - this is everything I want on the card:

$formatted = $row['addressee_display'] . "\n" . $row['contact.homestreetaddress'] . "\n" . $row['contact.homecity'] . ' ' . $row['contact.homepostalcode'] . "\n" . "\n" . 'License #: ' . $row['external_identifier'] . "\n" . $row['membership.type'] . "\n" . $row['contact.activityskills'] . "\n" . 'Start Date: ' . $row['membership.startdate'];

Eventually that gets passed onto self::createLabel($rows, $fv['label_name']);

Then my own function createlabel has all my custom layout for this organization: XY positioning of the details, font, logo (watermark) placement, authorized signature.

Hope this helps! You could just create the Tokens and then you might be able to get at them into a template - however if you really want control over layout/looks - you'll need your own createlabel.


I have recently created an extension for printing membership card. It is not as generic as I would like it to be but a good start IMO :)



I don't think that there is a function specific for membership cards, but I do believe that event badges is closer than adress labels.

If you enable CiviEvent, you will get another possibility. For participants of an event, you have the ability to print badges. The settings of badge printing will give you some more formatting options than an adress label.

I have not tried this according to your specification, but I do think it could be worth a try.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.