My content within ghost for free subscribers comes in the form of interactive forms vs static written content. I use tally.so for my forms.
I simply want to make sure that every free subscriber who is logged in does not have to fill out their name and email address every-time they fill in the form to get a respondent notification (sent by tally).
So the tally form somehow grabs their name and email address from ghost and inputs into a hidden fields in tally.so (form tool) and then send them the results of how they went/answered.
I understand ghost have attributes: @member.email@member.name but i just don’t understand how they feed into the hidden fields and how it works.
Thank you so much for helping out. Your code with the form ref 3Ek1vX brings up an error on the test page: Domain error
I also have tried the following two embeds and whilst they show up, they do now input the member name or member email into the hidden fields in the form.
Surely there is a way… I am not familiar how or where I would inject that script or what to modify.
Can you try using https://tally.so instead of just tally.so? I forgot to include the scheme, and without it, the URL resolves to https://test-profitable-questions.ghost.io/see-if-member-details-parse-on-in-a-tally-form/tally.so/embed/3ek1vx/
Are you adding this via code injection or as part of your theme? If it’s done via code injection, you need to use the other method I shared. If you’re adding this via an html block in the editor, you have to use code injection.
I don’t see the iframe or the injected code on https://test-profitable-questions.ghost.io/see-if-member-details-parse-on-in-a-tally-form/ - did you remove it? Make sure both parts exist!
If you created the URL via your theme, yes, every time you want to add a new form you would have to upload a new version of your theme. I would recommend code injection if you have multiple forms.
I’m trying to do something similar. I want to embed Tally forms into my posts and to pass the member email address (if available) as a query string.
Is this possible to do inside a (any) post? I had a quick play with the HTML embed block but it can’t parse the “#if” or “@member.email”. Is there any way that I can make this work?
Also, the email address will need to be URLencoded so how would you do this?
Here’s a way to embed a Tally form into a post and pass the member’s first name & urlencoded email address to the form as “hidden fields” (You could use the logic to create a custom contact form page).
Create a custom post that looks similar to the following; (copy everything under {{ content }} and before </section> and insert under the {{ content }} line of your template)
<section class='c-content {{#unless access}} c-content--has-shadow {{/unless}}'>
{{ content }}
{{#if @member}}
<iframe id="thetallyembed" data-tally-src="" loading="lazy" width="100%" height="" frameborder="0" marginheight="0" marginwidth="0" title="What content would you like to see?"></iframe><script>var d=document,w="https://tally.so/widgets/embed.js",v=function(){"undefined"!=typeof Tally?Tally.loadEmbeds():d.querySelectorAll("iframe[data-tally-src]:not([src])").forEach((function(e){e.src=e.dataset.tallySrc}))};if("undefined"!=typeof Tally)v();else if(d.querySelector('script[src="'+w+'"]')==null){var s=d.createElement("script");s.src=w,s.onload=v,s.onerror=v,d.body.appendChild(s);}</script>
<script>
let var_email = "{{@member.email}}";
let var_name = "{{@member.name}}";
let var_firstName = var_name.split(' ')[0];
let var_tallyurl = "https://tally.so/embed/" + var_formid + "?alignLeft=1&hideTitle=1&transparentBackground=1&dynamicHeight=1&email=" + encodeURIComponent(var_email) + "&firstname=" + var_firstName;
document.getElementById('thetallyembed').setAttribute('data-tally-src', var_tallyurl);
document.getElementById('thetallyembed').setAttribute('height', var_formheight);
</script>
{{/if}}
</section>
Then when you create a post
select this template
add the following code to the code injection Post header
<script>let var_formid = 'y3NXyr'; let var_formheight = 436;</script>
Set the formid to the Tally form id & the height of the form to whatever Tally’s embed code suggests you make it.