How to modify the dynamically created Shopify site after Newsletter subscription

Dear all,

I set up a 10% discount coupon for newsletter subscribers.

Now I am wondering if somebody could show me how I can modify this page: https://otaro-shop.com/account/subscribe?email=elg72723%40zzrgg.com&token=-4fl89huPoxEiHmCG4wVEC-alL…

It seems like this page is generated dynamically for each Subscriber of our Newsletter. I would like to add a nice button to activate a coupon (10% discount after he successfully susbscribed) and some basic HTML.

I know that I can add some text via the “Language” option (how already done) but HTML or adding a button is not possible with this adjustment…

Highly appreciate your help!

Best,

Adrian

Did you find a solution? I am also not able to finde the pages for email marketing (/account/subscribe etc.)

Did you find a solution to this?

I haven’t tried it out but these pages (although dynamically created and controlled by Shopify) use the page template. So you can use a conditional in liquid, test if the visitor is on the capcha page and then show a custom section or other code.

As in the page template for pages?

Sorry, I had to find the reference post. It is the theme.liquid file - not page.liquid.

{% if request.path == '/challenge' %}
{% render 'challenge' %}
{% else %}
{{ content_for_layout }}
{% endif %}

So in the theme.liquid file you can make a conditional for the request.path and then render a custom section.
However, in the case of the challenge page (the first step after the newsletter signup form has been submitted and captcha is enabled), the whole captcha validation might not be so easy. You’d need to do some research on the pitfalls and know exactly in which scenarios the challenge page is shown.

The page I am on about is the subscription confirmation page. It’s a page displayed after the customer verify a their subscription in the email they are sent when double opt-in is enabled. Sounds like this method might still work?

Yes, in theme.liquid just check what the request.path is and you can replace {{ content_for_layout }} with anything you like:

request.path

So I replaced

{{ content_for_layout }}

with

{% if request.path == '/account/subscribe' %}
{% render 'THIS IS A TEST' %}
{% else %}
{{ content_for_layout }}
{% endif %}

It replaced the content but with the following:

Liquid error: Could not find asset snippets/THIS IS A TEST.liquid

Do I need to create anothe file too?

Or do I just do it like this:

{% if request.path == '/account/subscribe' %}
# This is a test - MY HTML HERE
{% else %}
{{ content_for_layout }}
{% endif %}

Yes, {{ render }} refers to snippets.

This is another way of doing it. You are free to use snippets, sections or “direct” code (like the HTML in your last example).

perfect I will try with snippets as this will be neater.

My only concern is if there are any other pages that are build from this path.

for example the content I see is account/subscibe?email=… etc

but what if different content is genrated if there is a different query string used that I am not yet aware of.. I guess this will have to be trial and eror and LOTs of testing to make sure I havent replaced other content with a generic peice of content. does taht make sense?

Thanks though, works a treat

Great!

Yes, as I mentioned before You’d need to do some research on the pitfalls and know exactly in which scenarios the page is shown.

Like you say, trial and error, testing, researching will map the scenarios, and you can then apply the appropriate functionality to each.

the plu side the unsubscribe has its own page so it doesnt affect that one :slightly_smiling_face: that one is account/unsubscribe

Hello,

I’m facing with the same Issue what did you. I was wondering, did you manage to replace a Template as you wanted?

I don’t have much experience in the HTML, but I can do some basics, can you, please help me with the code, what need to be place in the content_for_layout to have us you have now in the email. I will appreciate your help highly.

Bestätige Deine Anmeldung

Bestätige Deine Anmeldung

Aufgrund der DSGVO brauchen wir eine Bestätigung von Dir, damit Du Deinen 10% Gutschein erhalten darfst.

Ja, ich möchte mich anmelden.

Wenn Du dich nicht für diesen Newsletter angemeldet hast oder nicht sicher bist, warum du diese E-Mail erhalten hast, musst Du diese E-Mail nicht weiter beachten. Du wirst nur zum Newsletter angemeldet, wenn Du auf den obigen Link klickst.

Falls Du Fragen hast, kannst Du auf diese E-Mail antworten. Adrian bei Adrian@otaro-shop.com.

Create a snippet file with your HTML

then follow the instructions on what to do with the theme.liquid file a few posts back. Replace THIS IS A TEST with the name of the snippet file (without the .liquid)

Thanks a lot tokant. It was very helpful.

Hello,

Thank you for this helpful discussion. I am able to create my subscription page as instructed herein, however, I would like to display different languages when needed. My original store language is German, however, I also have an “English” option.

Could you help me with that?

Kind regards,

Ayse