What code to add footer links to email notifications?

What code to add footer links to email notifications?

Lesleyprit
Visitor
3 0 0

I would love to add a footer section to my automatic email notifications.  

 

The Shopify email app lets you do add this by check-marking footer items in a selector tool;  the notification templates do not.  However, you ARE able to add any custom liquid code you like to the notifications...if you know what to add.  I don't know exactly which code to "grab" from my theme settings to copy/paste into the notification code.  The code the Shopify Email app uses to create a footer section is not visible for copying and pasting. 

 

Ideally I replicate the footer of my website so whatever footer choices are currently check-marked in my website theme settings would be active at the base of my emails in the same style and format - plus the unsubscribe hyperlink (not available for check-marking as a footer item in theme settings).  

 

Is it as simple as copying and pasting the footer liquid section and unsubscribe links or "referencing" them in a simple line or two of code?    I'm looking to have:

 

1.  Social media icons and active links

2.  Policy hyperlinks to terms of service and privacy policy

3.  Unsubscribe hyperlink

 

They would be functioning links and would take their style and formatting from the theme template choices that are active for my website.  Please advise 🙂

Replies 2 (2)

PaulNewton
Shopify Partner
7722 678 1627

Hi @Lesleyprit 👋 

@Lesleyprit wrote:

Is it as simple as copying and pasting the footer liquid section and unsubscribe links or "referencing" them in a simple line or two of code?


No, email only allows a subset of HTML and a lot of the time is a table based layout.

So be very rigorous in testing.

Just put in simple links nothing fancy to avoid pitfalls.

 

#1 respect peoples inbox, email is not a website avoid cluttering inboxes with excessive design insistence.

Be direct and on message.

#2 the theme editor is not for email, connecting the two systems is not a thing that exists for good reason , forcing that situation will just create a clunky experience as when the website updates you get the permanent chore of manually updating every email notification templates too or spending time figuring out how to automate it.

 

If you must match designs

Backup your current notification template.

Send yourself a shopifymail email and view the underlying html, or view the themes underlying rendered html:

find the relevant code copy out small isolated parts into the target notification template then test it > rinse repeat.

This may have the issue that the parts you copy out rely on parts of the whole email/theme or styles it contains.

Though if this is a live store you'll want to put the test code in a logic block that only shows for your specific account or some other logic.

There also some apps/services that sell premade notification templates.

 

When code if figured out either:

Put the code directly into every relevant template.

Or you can see if the newer metaobject system works with notifications in which case you can store the HTML in a metaobject and reference that in the notification-templates so there is 1 single place to edit the code drastically reducing longterm maintenance.

I haven't checked these two systems are connected so could be interesting.

 

 

If you have the budget and need this customization created then contact me by my email for services, or DM(slooower).
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


Lesleyprit
Visitor
3 0 0
Thanks so much for taking the time to respond!

I like the options you outlined.
Getting the HTML from a sent email would help to make a metaobject but it might be tricky for me to know which pieces to cherry-pick.

Would creating a hidden page for the footer content also be an option? Would it display?

I could separately create a metaobject for the unsubscribe - or find the url or section reference.

My next question would be what is the simplest code (dots, arrows, curly brackets, slash marks etc) to insert a page URL and/or a meta object or section reference into my notification code such that it will display the things they reference at the base of the email? Thanks 😊