# How to Build an Altru Query That Sends Digital Membership Cards Automatically

> Build the Altru sales order query that emails a digital membership card to every member the moment a membership sells: filters, output fields, note type.

Source: https://socialgoodsoftware.com/build-query-digital-membership-cards-altru/
Published: 2026-07-10 · Updated: 2026-11-20

---

[How to Build an Altru Query That Sends Digital Membership Cards Automatically (video)](https://www.youtube.com/watch?v=8smGNo2n0eo)

To send each new member their digital membership card the moment they buy, build an **ad-hoc Sales Order query** in Blackbaud Altru. It finds today’s membership sales, lists every member on each membership with their email, and skips sales that already have your card **note type**, so nobody gets the email twice. Email Designer then reads the query and sends the cards, with no batch processing to wait for.

**Before you start:** decide whether you’ll send one card email for all levels or one per level. The video builds the query for a single level (Individual membership), and the query is the same for any other level. You’ll also create a sales order note type partway through, so you need access to code tables ([how to create a custom sales order note type](https://socialgoodsoftware.com/how-to-create-a-custom-note-type-with-altru/)).

## What’s covered

1. [0:57](https://www.youtube.com/watch?v=8smGNo2n0eo&t=57s) **Create the query.** Go to **Analysis › Information library**, add an ad-hoc query, choose **Sales Order**, and remove **Lookup ID**. Pay close attention to fields, because you’re working from a sales order, not a membership.
2. [1:38](https://www.youtube.com/watch?v=8smGNo2n0eo&t=98s) **Transaction date on or after yesterday.** Purchases late at night, around 11 or 11:30 pm, can be dated as the next day in Altru, so “yesterday” makes sure they’re caught.
3. [2:17](https://www.youtube.com/watch?v=8smGNo2n0eo&t=137s) **Filter to the membership.** Either **Sales order item › Description** contains the membership name (for example *Museum membership*), or ([2:57](https://www.youtube.com/watch?v=8smGNo2n0eo&t=177s)) **Sales order item membership › Membership level › Name** is one of your levels, with **Only return selected records that match these values** ticked.
4. [3:57](https://www.youtube.com/watch?v=8smGNo2n0eo&t=237s) **Amount greater than 0 (optional).** Leave it out if a level is free. The amount is for the whole transaction, not just the membership.
5. [4:46](https://www.youtube.com/watch?v=8smGNo2n0eo&t=286s) **Membership transaction ID is not blank.** This limits results to membership purchases. It’s redundant when you filter by level, but required if you filter by description.
6. [5:33](https://www.youtube.com/watch?v=8smGNo2n0eo&t=333s) **Is dropped equals No.** Under the membership’s **Members**, this removes people who were once on the membership but no longer are, so they don’t get the email.
7. [6:43](https://www.youtube.com/watch?v=8smGNo2n0eo&t=403s) **Include every member.** Under **Membership › Members › Constituent**, add *(Primary email address equals Yes* **or** *Email address is blank)*, with the parentheses, so a membership with four members returns all four.
8. [8:08](https://www.youtube.com/watch?v=8smGNo2n0eo&t=488s) **Exclude sales already emailed.** **Notes › Note type** is *not one of* your card note type, for example *Digital Membership Card – Individual Membership*. Use a placeholder until you create the note type.
9. [8:55](https://www.youtube.com/watch?v=8smGNo2n0eo&t=535s) **Output the member’s first name, membership ID and membership level twice.** One level is shown in the email; the other makes the link open the right card when a member holds two active memberships ([10:01](https://www.youtube.com/watch?v=8smGNo2n0eo&t=601s)).
10. [10:53](https://www.youtube.com/watch?v=8smGNo2n0eo&t=653s) **Add the email fields.** Expiration date, transaction date, amount paid, the email address entered at purchase, and the **sales order record ID**, which is where the note is attached after the email sends.
11. [11:34](https://www.youtube.com/watch?v=8smGNo2n0eo&t=694s) **Add the member fields.** A second first name (one addresses the person, one goes on the card), **Primary member**, each member’s **constituent record ID** (used to look up their card) and the membership’s **system record ID** (used to group members). Rick recaps the three IDs at [12:54](https://www.youtube.com/watch?v=8smGNo2n0eo&t=774s).
12. [14:18](https://www.youtube.com/watch?v=8smGNo2n0eo&t=858s) **Sort by Primary member, Z to A,** so the email always addresses the primary member.
13. [14:57](https://www.youtube.com/watch?v=8smGNo2n0eo&t=897s) **Name and save.** Add a description such as “Please do not remove this query; it is used to send real-time emails for SGS to welcome new members using digital membership cards.”
14. [15:49](https://www.youtube.com/watch?v=8smGNo2n0eo&t=949s) **Create the note type.** In **Administration › Code tables**, under the Ticketing category, open the sales order note type table and add your note type. Then **Edit definition** on the query and swap it into the note type filter.
15. [17:03](https://www.youtube.com/watch?v=8smGNo2n0eo&t=1023s) **Segment by level if needed.** Copy the query for each level. If members can hold more than one membership and should get a card email for each, give each level its own note type; otherwise one generic note type works.
16. [18:21](https://www.youtube.com/watch?v=8smGNo2n0eo&t=1101s) **The final query,** including *Is dropped equals No*.

## Key takeaways

- The note type filter is what stops repeat emails: once a card email sends, a note is attached to the sales order and the sale drops out of the query.
- Output membership level twice and keep all three record IDs. The email, the card lookup and member grouping each depend on one of them.
- Don’t skip *Is dropped equals No*, or former members of a membership can receive its card email.
- Test before you rely on it. Rick says these queries are tricky to get right and there’s no one-size-fits-all; treat this as a starting point and confirm it works for your organization’s data.
- Next, point an Email Designer template at the query: see [how to create an email template in Email Designer](https://socialgoodsoftware.com/how-to-create-an-email-template/). More on the product is on the [Digital Membership Cards](https://socialgoodsoftware.com/features/digital-membership-cards) page.

## Common questions

### Why use a Sales Order query instead of a Membership query?

This query is meant to catch new purchases as they happen, so it starts from the sale and reaches into the membership for its members. That also gives Email Designer a sales order to attach its note to.

### Why “on or after yesterday” and not “today”?

Late-night purchases can land on the next day in Altru, so reaching back one day makes sure no sale is missed. The note type filter keeps those sales from being emailed twice.

### Will members with no email address break the query?

No. The email filter includes them on purpose so every member on the membership comes through, including those without an email address.

### Do I need a separate query and note type for every level?

Only if you segment by level. If members can hold more than one membership at once and you want them to get each card, use a note type per level. Otherwise one generic note type is enough ([17:32](https://www.youtube.com/watch?v=8smGNo2n0eo&t=1052s)).

### Why does the preview show no rows?

The query only returns recent sales. If nothing has sold since yesterday, it’s empty ([14:50](https://www.youtube.com/watch?v=8smGNo2n0eo&t=890s)).

---

Social Good Software adds modern checkouts, timed-ticketing calendars, membership portals, and digital membership cards on top of Blackbaud Altru, without replacing it. Book a 1-on-1 demo: https://socialgoodsoftware.com/demo?src=llms · Call 801-822-0183 · hello@socialgoodsoftware.com · Site summary for AI assistants: https://socialgoodsoftware.com/llms.txt
