Created
October 10, 2017 17:08
-
-
Save asimoesmcartor/b0c6f7021da65ec2987fd25b870370de to your computer and use it in GitHub Desktop.
Remove last letter of first name (if it contains 's' or 'ς') and display it in email
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
{% capture name %}{{recipient.first_name}}{%endcapture%} | |
{% assign size = name | size | minus: 1 %} | |
{% capture lastletter %}{{ name | slice: size, 1 }}{%endcapture%} | |
{% if lastletter == 's' or lastletter == 'ς' %} | |
{{ name | slice: 0, size }} | |
{%else%} | |
{{recipient.first_name_or_friend}} | |
{%endif%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment