← All projects
Tavern Group: Personalized Welcome Series
One set of templates that welcomes new members across five pub venues. Each email shows the member's own venue, events and offer code.
01 · The result
What subscribers actually receive
Swipe to compare →Same template, three members. The venue branding, manager sign-off and subject line all come from the data. Member 1003 has no first name, so the fallback greeting and subject line kick in.
The full series
02 · How I built it
The logic, in plain English
- Pulled the venue name, logo, address, manager and socials from a Venue Data Extension with
LookupRows, matched on the member's VenueID. - Cleaned names with
TrimandProperCase, with a "member" fallback and a subject line that changes when the name is missing. - Built a unique redemption code from the venue's voucher prefix and the member ID, e.g. GDNEW789-1002.
- Added
RaiseErrorso the send is cancelled if a venue record is missing. Nobody gets a broken email.
03 · Under the hood
The detail I like: no "The The Red Lion"
A short excerpt. The full code and the brief's requirements are on GitHub.
AMPscript01-Initial-Welcome-Email.ampscript
/* NAME CLEANING WITH FALLBACK */ IF NOT EMPTY(@firstName) THEN SET @finalName = Propercase(Trim(@firstName)) ELSE SET @finalName = "member" ENDIF /* CHECK IF "THE" ALREADY EXISTS AT THE START OF VENUE NAME */ IF IndexOf(Lowercase(Trim(@VenueName)), "the ") == 1 THEN SET @finalVenueName = Trim(@VenueName) ELSE SET @finalVenueName = Concat("The ", Trim(@VenueName)) ENDIF





