How to display different greetings (morning, afternoon, evening) based on the current time? Answered
Anyone know of a way to set conditional logic for a greeting message, like "Good [Morning] , [Afternoon], [Evening], [USER]"?
Anyone know of a way to set conditional logic for a greeting message, like "Good [Morning] , [Afternoon], [Evening], [USER]"?
Comments
5 comments
Hey Jonathan 👋 That would take some custom code. Adding to my list for #memberscript-updates
Well, the date/time thing would require code. You can use attributes to display the user info.
https://docs.memberstack.com/hc/en-us/articles/11384437115803
Perfect, thank you!
Chatgpt could definitely crank that one out!!
Here's a code snippet that should work.
Ensure you have an HTML element with the id of 'greeting' where you want the greeting to appear. The script will update the text content of that element with the appropriate greeting based on the current time of the day.
Jonathan Gallegos checkout #memberscript-updates
Please sign in to leave a comment.