You Spoke, We Listened: Supercharged Templates & Frontend Event Delivery are Here!
At MsgGO, we're constantly striving to make your notification workflows smoother, more powerful, and, frankly, less of a headache. Your feedback is our roadmap, and today, we're thrilled to announce some highly requested features that are set to do just that. We’ve rolled out a major revamp to our message templating system – say hello to Twig! – and introduced the ability to define templates right when you're setting up a delivery. Plus, we're making it easier to send events directly from your frontend applications.
Let's dive in and see how these updates can make your life a bit easier. Sound good?
Supercharge Your Notifications: Introducing Twig, Markdown, and Streamlined Template Management
If you've ever found yourself wishing for more flexibility in how your notifications look and feel, or gotten tired of jumping between settings to create a message template, this one's for you. We've given our message templating a serious upgrade.
Meet Twig: Your New Templating Powerhouse
Remember the days of basic variable substitution? Well, they're evolving! We've integrated Twig, a modern, fast, and incredibly flexible template engine (originally for PHP, but we’ve adapted its power for MsgGO).
So, why Twig? And why should you care?
- Simplicity Meets Power: Twig is renowned for its easy-to-learn syntax, making it accessible even for less technical team members. But don't let its simplicity fool you; it packs a punch with features like conditionals, loops, and filters.
- Flexibility Unlocked: Customize your messages like never before. Change content based on event data, format dates, iterate over lists – you name it.
- Speed & Efficiency: Twig is designed for performance, ensuring your dynamic templates are processed quickly.
Let's look at a quick example. Imagine you want to send different Slack messages based on a deployment status:
{% if data.status == 'success' %}
🚀 Heads up, team! Deployment of `{{ data.service_name }}` to `{{ data.environment }}` was a **SUCCESS**! {% if data.version %}Version: `{{ data.version }}`{% endif %}
Let's celebrate! 🎉
{% elseif data.status == 'failed' %}
⚠️ Critical Alert! Deployment of `{{ data.service_name }}` to `{{ data.environment }}` **FAILED**.
Error details: {{ data.error_message | default('No specific error message provided.') }}
Check pipeline: {{ data.pipeline_url }}
All hands on deck!
{% else %}
⏳ Heads up: `{{ data.service_name }}` deployment to `{{ data.environment }}` is currently in progress.
We'll keep you posted!
{% endif %}
See that? With a few lines of Twig, you can create highly contextual and informative notifications. Conditional logic, access to data
payload, and even default values if something's missing – pretty neat, huh? This means clearer, more actionable alerts for your team.
Craft Beautiful Messages with Markdown
Plain text is fine, but sometimes you need a little more oomph. We now support Markdown for your message templates! This makes creating beautifully formatted emails or rich Slack messages a breeze. Use headings, bold/italic text, lists, code blocks, and links to make your notifications more readable and engaging. Seriously, your teammates (and your eyes) will thank you.
Streamlined Workflow: Define Templates on the Fly!
We get it. Clicking back and forth to create a template and then assign it to a delivery can be a bit of a workflow bump. Not anymore! You can now define your message template directly when you're adding a new delivery target for an event. This speeds up the setup process considerably, letting you get back to what you do best – building awesome stuff.
Frontend Freedom: Sending Events Directly from Your Website (with an Important Security Note!)
Ever wanted to send a notification from your website – like a contact form submission or a user interaction – without spinning up a backend endpoint just for that? Well, now you can!
We've enabled a way to send events to MsgGO directly from your frontend JavaScript. This opens up possibilities for quick integrations and simpler use cases. For example, you can now handle contact form submissions by sending the data straight to a MsgGO event, which then routes it to email, Slack, or your CRM via a webhook. We even wrote a post about this specific scenario: Handling Contact Forms with MsgGO.
Why is this cool? For certain scenarios, it reduces complexity and development time. No need to write and deploy server-side code for simple event forwarding.
A Crucial Word on Security: Handle with Care!
Now, this is important. Sending events directly from the frontend means you'll be using a Public API Key. As the name suggests, this key will be visible in your client-side code. While Public API Keys in MsgGO have built-in protections like domain restrictions (only allowing requests from your specified domains) and rate limits to prevent abuse, it's still a different security posture than using a Private API Key from a secure backend.
Our Strong Recommendation: For most production scenarios, especially those involving sensitive data or operations where you need the full power and security of a Private API Key (which should never be exposed in frontend code), we still strongly recommend using a backend proxy. This pattern involves your frontend sending data to your own backend endpoint, which then securely forwards the event to MsgGO using a Private API Key. This keeps your Private API Key safe and gives you more control.
So, while direct frontend delivery is a great new tool in your MsgGO toolkit for specific, less sensitive use cases, always evaluate the security implications.
What's Next?
We're incredibly excited for you to try out these new enhancements. The revamped message templates with Twig and Markdown, along with the streamlined workflow, are designed to give you more power and save you time. And the new frontend event delivery option offers another way to integrate MsgGO, as long as it's used wisely.
Dive in, explore the new features, and as always, let us know what you think! Your feedback continues to shape MsgGO.
Happy Notifying!
– The MsgGO Team
P.S. Don't forget to check out our updated Message Templates documentation for a deeper dive into Twig and all its capabilities!