Skip to main content

Special Links

Define custom link types that appear in the link editor dropdown alongside standard URL and email links.

import { useRef } from 'react';
import { PexelizeEditor, PexelizeEditorRef } from '@pexelize/react-editor';

function SpecialLinksEditor() {
const editorRef = useRef<PexelizeEditorRef>(null);

return (
<PexelizeEditor
ref={editorRef}
editorKey="pk_your_key"
editorMode="email"
options={{
specialLinks: [
{
name: 'Unsubscribe',
href: '{{unsubscribe_url}}',
group: 'System Links',
},
{
name: 'View in Browser',
href: '{{web_view_url}}',
group: 'System Links',
},
{
name: 'Manage Preferences',
href: '{{preferences_url}}',
group: 'System Links',
},
{
name: 'Company Website',
href: 'https://example.com',
group: 'Brand Links',
},
],
}}
/>
);
}

When a user selects a button, image, or text link, the special links appear as a dedicated section in the link picker.

// React
editorRef.current?.editor?.setSpecialLinks([
{ name: 'Unsubscribe', href: '{{unsubscribe_url}}', group: 'System Links' },
{ name: 'Referral Link', href: '{{referral_url}}', group: 'Campaign' },
]);

// Vanilla JS
pexelize.setSpecialLinks([
{ name: 'Unsubscribe', href: '{{unsubscribe_url}}', group: 'System Links' },
{ name: 'Referral Link', href: '{{referral_url}}', group: 'Campaign' },
]);
Combine with merge tags

Special link href values can use merge tag syntax. Your email sending platform resolves these at delivery time, so {{unsubscribe_url}} becomes a real link for each recipient.

Required for CAN-SPAM compliance

Email regulations require an unsubscribe link. Add one as a special link so users cannot accidentally remove or mistype it.

Method reference

MethodReturnsDescription
setSpecialLinks(links)voidReplace the special links list at runtime

Next steps