Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Testing liquid variables on Teachable
<!--
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>
@paulmil11

This comment has been minimized.

Copy link

@paulmil11 paulmil11 commented May 9, 2020

hey where did you find all the teachable liquid codes? the list teachable offers is missing a bunch of these

@alxpck

This comment has been minimized.

Copy link
Owner Author

@alxpck alxpck commented May 11, 2020

@paulmil11 Honestly, I don't remember.

Looking at this gist I feel like I copy/pasted from somewhere else to keep it as a note-to-self.

I remember having so much difficulty working with the teachable liquid codes.

I may have pulled a shopify template and tried brute forcing these codes since it seemed there was overlap where teachable had followed shopify's naming schemes.

Sorry, I wish I could say with more certainty.

@paulmil11

This comment has been minimized.

Copy link

@paulmil11 paulmil11 commented May 15, 2020

haha same @alxpck - thanks for responding

@alxpck

This comment has been minimized.

Copy link
Owner Author

@alxpck alxpck commented May 15, 2020

👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment