Skip to content

Drop HTML sample email templates from unpackaged/post - #223

Merged
DKeatonDC merged 1 commit into
mainfrom
bug/drop-html-sample-templates
Aug 14, 2026
Merged

DKeatonDC merged 1 commit into
mainfrom
bug/drop-html-sample-templates

Conversation

@jstvz

@jstvz jstvz commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What this does

Removes the two HTML sample email templates from unpackaged/post/email/Unsubscribe_Link/. Keeps the plain-text sample and fixes its merge field.

Why

The new package Unsubscribe-Link-4 delivers sample templates as unmanaged metadata through unpackaged/post, not inside the package. The two HTML samples cannot deploy this way.

The HTML samples call the packaged Visualforce component:

<c:UnsubscribeLink recipientId="{!recipient.Id}"></c:UnsubscribeLink>

When the sample lands in the subscriber default namespace (c) and the component stays in UnsubscribeLnk, the call crosses a namespace boundary. The platform then enforces a stricter rule: every attribute passed to a managed component from another namespace must be access="global". The recipientId attribute is not global, so the deploy fails:

Cannot use attribute recipientid (in component unsubscribelnk:unsubscribelink)
without global access in a component/page that is not in the same namespace
as the component

This is a consequence of the "deliver samples via unpackaged/post" model, not a template typo. It has been true since the component was first created (checked release/0.3.0.2); the package model just exposed it.

Changes

  • Remove Unsubscribe_Contact_Template_HTML.email (+ meta).

  • Remove Unsubscribe_Lead_Template_HTML.email (+ meta).

  • Keep Unsubscribe_Lead_Template_Plain_Text.email. Add the CumulusCI namespace token so the merge field resolves in both managed and unmanaged contexts:

    {!Recipient.%%%NAMESPACE%%%Unsubscribe_Url_Plain_Text__c}
    

Verification

Built 1.0.0.1 of the new package and ran the same test the beta-test CI job runs after merge (ci_beta: install the managed package, deploy unpackaged/post, run Apex tests), pinned to 04tKf000000kjbHIAQ, in a fresh scratch org.

  • Managed package install: PASS. No unfiled$public collision.
  • Plain-text sample deploy: PASS.
  • Apex tests: PASS.

HTML sample follow-up

HTML sample delivery is a product decision, tracked in a follow-up comment on #217. Two options: make the component attribute global and rebuild (a public-API commitment, new version), or ship the HTML sample as copy-paste documentation. This PR does not decide that. It only unblocks the install path.

The two HTML sample templates cannot deploy as unmanaged metadata via
unpackaged/post. They reference the packaged Visualforce component across
a namespace boundary, and the component attribute recipientId is not
access="global". The platform rejects the cross-namespace call:

  Cannot use attribute recipientid without global access in a
  component/page that is not in the same namespace as the component

Remove:
- Unsubscribe_Contact_Template_HTML.email (+ meta)
- Unsubscribe_Lead_Template_HTML.email (+ meta)

Keep the plain-text sample. Add the CumulusCI namespace token so the
merge field resolves in both managed and unmanaged contexts:

  {!Recipient.%%%NAMESPACE%%%Unsubscribe_Url_Plain_Text__c}

With this change the install path deploys clean. HTML sample delivery is
left as a product decision (see follow-up on #217).

@DKeatonDC DKeatonDC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes make sense and should proceed.

@DKeatonDC
DKeatonDC merged commit e828cda into main Aug 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants