Shopify Email syntax error, need help

Solved

Shopify Email syntax error, need help

Deadly_Dukes
Tourist
10 0 0

I am trying to make a custom e-mail telling everyone we now have a loyalty program. I am using shopify e-mail marketting. It keeps telling my i have a syntax error on line 80

 

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: Arial, sans-serif;
background-color: #f8f8f8;
margin: 0;
padding: 0;
}
.container {
width: 100%;
max-width: 600px;
margin: 0 auto;
background-color: #ffffff;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.header {
text-align: center;
padding: 20px 0;
background-color: #D303FF;
color: white;
}
.header h1 {
margin: 0;
font-size: 28px;
}
.content {
padding: 20px;
text-align: center;
}
.content h2 {
color: #D303FF;
font-size: 24px;
}
.content p {
color: #333;
font-size: 16px;
line-height: 1.5;
}
.button {
display: inline-block;
padding: 12px 25px;
background-color: #D303FF;
color: #ffffff;
text-decoration: none;
font-size: 16px;
border-radius: 5px;
margin-top: 20px;
transition: background-color 0.3s ease;
}
.button:hover {
background-color: #e0558f;
}
.footer {
text-align: center;
padding: 15px;
font-size: 12px;
color: #777;
background-color: #f0f0f0;
border-top: 1px solid #dddddd;
}
.footer a {
color: #ff69b4;
text-decoration: none;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>What She Needs</h1>
</div>
<div class="content">
<h2>Introducing Our New Loyalty Program!</h2>
<p>We are thrilled to offer you an opportunity to earn points with every purchase. Accumulate points and enjoy exclusive discounts, rewards, and special offers. It's our way of saying thank you for being a valued customer!</p>
<a href="https://www.whatsheneeds.ca" class="button">Join Now & Start Earning</a>
</div>
<div class="footer">
<p>Would you like to <a href="{{ unsubscribe_link }}"></a>?</p>
<p>&copy; 2024 What She Needs. All Rights Reserved.</p>
</div>
</div>
{{ email_footer }}
{{ open_tracking_block }}
</body>
</html>

 

i underlined the line that has issues.

Accepted Solution (1)
PaulMartin
Shopify Partner
591 58 139

This is an accepted solution.

Well, that was unexpected 😬 Try this:

<p>Would you like to {{ unsubscribe_link }}?</p>
[email protected]
Feel free to email me! 😄
I'm open to conversations or work ʕ •ᴥ•ʔ

View solution in original post

Replies 14 (14)

PaulMartin
Shopify Partner
591 58 139

From the looks of it, the underlined line:

 

<a href="https://www.whatsheneeds.ca" class="button">Join Now & Start Earning</a>

 

Has no syntax error 

[email protected]
Feel free to email me! 😄
I'm open to conversations or work ʕ •ᴥ•ʔ
Deadly_Dukes
Tourist
10 0 0

emailhelp.png

 that's what i thought but this pops up

PaulMartin
Shopify Partner
591 58 139

That's weird. Can you try removing it for the moment and try saving it? Just to confirm that it's actually

<a href="https://www.whatsheneeds.ca" class="button">Join Now & Start Earning</a>

causing the problem

[email protected]
Feel free to email me! 😄
I'm open to conversations or work ʕ •ᴥ•ʔ
Deadly_Dukes
Tourist
10 0 0

once i removed it the code worked... is it potentially something the shopify email does not allow?

 

PaulMartin
Shopify Partner
591 58 139

Huh, weird. Not entirely sure, but emails have strict rules when it comes to links. Try using this:

<a href="{{ shop.secure_url }}" class="button">Join Now & Start Earning</a>
[email protected]
Feel free to email me! 😄
I'm open to conversations or work ʕ •ᴥ•ʔ
Deadly_Dukes
Tourist
10 0 0

same thing... =[

 

PaulMartin
Shopify Partner
591 58 139

Can you try removing the ampersand and replacing it with "and"?

<a href="{{ shop.secure_url }}" class="button">Join Now and Start Earning</a>
[email protected]
Feel free to email me! 😄
I'm open to conversations or work ʕ •ᴥ•ʔ
Deadly_Dukes
Tourist
10 0 0

That definitely did it and helped, but now do you know how to fix the "> next to unsubscribe?

 

<div class="footer">
<p>Would you like to <a href="{{ unsubscribe_link }}"></a>?</p>
<p>&copy; 2024 What She Needs. All Rights Reserved.</p>

 

i think i need that in there to have proper syntax dont i? screenshot for reference...

Screenshot 2024-09-23 2234241.jpg

PaulMartin
Shopify Partner
591 58 139

Ah, it was the ampersand. Awesome!

Try this:

<p>Would you like to <a href="{{ unsubscribe_link }}">Unsubscribe</a>?</p>
[email protected]
Feel free to email me! 😄
I'm open to conversations or work ʕ •ᴥ•ʔ
Deadly_Dukes
Tourist
10 0 0

sc1.png

it kinda made it worse 😛

PaulMartin
Shopify Partner
591 58 139

This is an accepted solution.

Well, that was unexpected 😬 Try this:

<p>Would you like to {{ unsubscribe_link }}?</p>
[email protected]
Feel free to email me! 😄
I'm open to conversations or work ʕ •ᴥ•ʔ
Deadly_Dukes
Tourist
10 0 0

you are amazing!

PaulMartin
Shopify Partner
591 58 139

Awesome! Glad I helped! 🙂

If, in the future, you're looking for a developer to help you with store problems, feel free to contact me via my website below, you'll also find my contact email there.

[email protected]
Feel free to email me! 😄
I'm open to conversations or work ʕ •ᴥ•ʔ
Deadly_Dukes
Tourist
10 0 0

i will tyvm