Right now I have two sets of templates, one for commercial sends, and one for transactional sends. My commercial template has a table with my opt-out/manage profile links. Is it possible to use AMPscript to hide that table if the send is transactional?

1 Answer 1


Since the Send Classification is defined at the Send Definition level (e.g. Guided, User-Initiated, Triggered Send), not on the Email level, the only scripting option you have is to do an API retrieve on the Send Definition using the AMPScript API functions. Those may be restricted to Landing Pages.

How are you Send Definitions configured? Are there data elements in the send that you can use to classify emails as Transactional vs Commercial?

EDIT 2023-01-16

If you don't mind the overhead of a lookup, you can use something like this to determine the Send Classification:

if not empty(attributevalue("jobid")) and jobid > 0 then

  set @sendclassification0 = lookup("_job","sendclassificationtype","jobid", jobid)
  set @sendclassification = 'Commercial'

  if not empty(@sendclassification0) and indexof(@sendclassification0,"trans") > 0 then
    set @sendclassification = 'Transactional'

  • Thank you for your useful idea and information! I did not know the data view can be treated like a DE for AMPscript function. Your example code above is missing an "endif" statement by the way
    – Duc Le
    Commented Jan 18, 2023 at 3:17
  • Added the missing endif. Thanks Commented Jan 18, 2023 at 4:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .