Updated for special SMS handling

This commit is contained in:
wess committed 2024-02-06 13:11:05 -05:00
1 parent 3f0e60d0c2
commit 6edea22cc4
1 file changed
+2 -1
@@ -12,10 +12,11 @@
const createMessage = (providerText:string) => {
const vowels = ['a', 'e', 'i', 'o', 'u'];
const firstLetter = providerText.toLowerCase().charAt(0);
const lastLetter = providerText.charAt(providerText.length - 1);
const lastLetter = providerText.toLowerCase().charAt(providerText.length - 1);
let article = vowels.includes(firstLetter) ? 'an' : 'a';
article = lastLetter === 's' ? '' : article;
providerText = providerText.toLowerCase() === 'sms' ? 'SMS messages' : providerText;
return `Create ${article} ${providerText} that will be displayed to your subscribers. Learn more in our documentation.`;
};
</script>