Skip to content

Instantly share code, notes, and snippets.

@asimoesmcartor
Created October 10, 2017 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asimoesmcartor/b0c6f7021da65ec2987fd25b870370de to your computer and use it in GitHub Desktop.
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
{% 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