Liguid syntax error: Endif is not a valid delimiter

So I’m creating my email marketing. I use Klaviyo and then I paste that into my Shopify Notifications.

I’m not creating my third email and I get this error:

I have never worked with code before, but after getting this I tried replacing all the “endif” with “endfor”, which resultet in the same message, except then it told me there was an error with “endfor” and told me to use "endif…

Can anyone help?

I have the entire code, but I don’t know what part to post cause I can’t exceed 20,000 characters.

Does anyone know anything about this problem, or what part to post so you guys can see?

Hello madsforsberg

You don’t need to replace endfor with endif, you need to check that when you are pasting the code you might have missed if statement or else an extra endif must have been added to the file.

With out code access can’t check anything.

If you give me an access I will let you know the error or the issue.

1 Like

Funny enough I figured out some of it, the code automatically inserted an endif instead of an endfor, so I just changes it.

However I have trouble with creating the code for the email in general.

It’s a order refund email and I can’t seem to get the negative price inserted to indicate the refund both in the top and in the subtotal on the bottom, and I can’t get the pictures in as well showing the negative price
Is there any way you can help me with that?

1 Like

Hello Mads,

I have exactly the same problem as you. You say it automatically changed, I don’t see how mine can do that - can you help?

Did you find a way to fix it? I’m having the same problem with my shipping confirmation e-mail

Hello everyone, I have the same problem. The created code in Klaviyo cannot be inserted into Shopify. It’s a mail for order confirmation. I will gladly provide the code. I would be very happy if someone could help me. Thanks a lot. Best regards

I fixed this by wrapping every text in its own WHEN IF ELSE statement.

Very inefficient but it works.

I think this is error throws because of nesting too many statements in the big chunck of HTML?

FOR EXAMPLE

Hello,

I’m having the same problem. Can you help?

Here’s the error I’m getting:

Body html Liquid syntax error: ‘endfor’ is not a valid delimiter for if tags. use endif

Thanks,

Kristin