diff --git a/src/routes/console/project-[project]/messaging/wizard/step1.svelte b/src/routes/console/project-[project]/messaging/wizard/step1.svelte index 4fffcc771d..68a6bc3d3b 100644 --- a/src/routes/console/project-[project]/messaging/wizard/step1.svelte +++ b/src/routes/console/project-[project]/messaging/wizard/step1.svelte @@ -8,6 +8,17 @@ import PushFormList, { validateData } from './pushFormList.svelte'; async function beforeSubmit() {} + + const createMessage = (providerText:string) => { + const vowels = ['a', 'e', 'i', 'o', 'u']; + const firstLetter = providerText.toLowerCase().charAt(0); + 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.`; + }; Message - Create an {providers[$providerType].text} that will be displayed to your subscribers. Learn more - in our documentation. + {createMessage(providers[$providerType].text)} {#if $providerType === ProviderTypes.Email}