Created
April 21, 2017 19:36
-
-
Save alxpck/e959f53383397ee03cff8bf3dc97f01d to your computer and use it in GitHub Desktop.
Testing liquid variables on Teachable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Email template: student/purchase_notification | |
Description: This email is sent to a student when they enroll in a course. | |
--> | |
<!-- Email Title --> | |
<div class="header-title"> | |
<h1>{{text.email_receipts.thank_you_for_enrolling_in }} {{sale.course.name }}</h1> | |
</div> | |
<!-- Content --> | |
<p>Welcome, {{ text.user.name }}. try (text.user.name)</p> | |
<p>Welcome, {{ user.name }}. try (user.name)</p> | |
<p>We've set up your account.</p> | |
<p>Your username is: {{ user.email }} try (user.email )</p> | |
<p>Your username is: {{ text.user.email }} try (text.user.email )<br> | |
Your temporary password is: Mh9Zw979D2bSHYug</p> | |
<p>Please change the password as soon as you log in.</p> | |
<p>To get started, click the button below. Follow the simple steps, and you're in.</p> | |
<p class="text-center"><a href="https://sso.teachable.com/secure/113985/users/sign_in?clean_login=true&reset_purchase_session=1" class="btn-primary">Click here to log in</a></p> | |
<br><hr><br> | |
{% unless sale.free? or sale.payment_method == 'external' %} | |
<h1 class="price-jumbo">{{ sale.receipt_formatted_charge }}</h1> | |
<table class="data-table" cellpadding="0" cellspacing="0"> | |
<tr> | |
<td width="50%">{{text.email_receipts.receipt_number}}</td> | |
<td class="text-right">{{sale.id}} </td> | |
</tr> | |
<tr> | |
<td width="50%">{{text.email_receipts.product_id}}</td> | |
<td class="text-right">{{product.id}}</td> | |
</tr> | |
<tr> | |
<td width="50%">{{text.email_receipts.course_name}}</td> | |
<td class="text-right">{{sale.course.name}}</td> | |
</tr> | |
<tr> | |
<td width="50%">{{text.email_receipts.purchase_date}}</td> | |
<td class="text-right">{{sale.purchase_date}} {{text.email_receipts.utc}}</td> | |
</tr> | |
<tr> | |
<td width="50%">{{text.email_receipts.purchaser}}</td> | |
<td class="text-right">{{to.name}}<br><a href="mailto:{{to.email}}">{{to.email}}</a> </td> | |
</tr> | |
{% if sale.vat_tax_id %} | |
<tr> | |
<td width="50%">{{text.email_receipts.purchaser_vat_id}}</td> | |
<td class="text-right">{{ sale.vat_tax_id }}</td> | |
</tr> | |
{% endif %} | |
<tr> | |
<td width="50%">{{ text.email_receipts.vendor }}</td> | |
<td class="text-right">{{ school.name }}<br><a href="{{school.url}}">{{school.url}}</a> </td> | |
</tr> | |
{% if sale.vendor_vat_id %} | |
<tr> | |
<td width="50%">{{ text.email_receipts.vendor_vat_id }}</td> | |
<td class="text-right">{{ sale.vendor_vat_id }}</td> | |
</tr> | |
{% endif %} | |
<tr> | |
<td width="50%">{{text.email_receipts.list_price}}</td> | |
<td class="text-right">{{sale.receipt_list_price}}</td> | |
</tr> | |
{% if sale.discounted? %} | |
<tr> | |
<td width="50%">{{text.email_receipts.discount }} ({{sale.coupon_code}})</td> | |
<td class="text-right">{{sale.receipt_discount_amount }}</td> | |
</tr> | |
{% endif %} | |
{% if sale.taxed? %} | |
<tr> | |
<td width="50%">{{ text.email_receipts.tax }}</td> | |
<td class="text-right">{{ sale.receipt_tax_amount }}</td> | |
</tr> | |
{% endif %} | |
<tr class="total"> | |
<td width="50%">{{text.email_receipts.total }}</td> | |
<td class="text-right">{{ sale.receipt_formatted_charge }}</td> | |
</tr> | |
</table> | |
{% endunless %} | |
<!-- Auto-generated JSON-ld compliant JSON for showing action buttons in emails --> | |
<script type="application/ld+json">{{ goto_action_json }}</script> |
👍🏼
there is this liquid variable name "Course" in teachable how do we get those liquid variables.
Like for say I want to get the course name. How will we do it?
Hey sorry @noman26636 I don't know.
I either pulled these from a liquid template I found on a marketplace that referenced them OR I reverse-engineered these codes with trial and error. It's been so long I don't remember how I did it—I'm not using Teachable as a platform anymore so I'm not up-to-date.
Wish I could offer more guidance. :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
haha same @alxpck - thanks for responding