The OrderCloud Platform is a great way to solve complex B2B eCommerce and order management challenges. But a key part of eCommerce is notifications! Users expect notifications when they place an order, get a shipment, etc. The OrderCloud platform provides a powerful tool to trigger notifications based on OC Platform events: Message Senders.
We provide a built-in Message Sender configuration to use with MailChimp/Mandrill, but if you have a different preferred email sender or want to provide some other form of notification, you can write your own custom Message Sender.
If you'd like to proceed with the Mandrill Message Sender, you need the following:
- A MailChimp account with the Mandrill Transactional Email add-on
- Your Mandrill API Key (this can be found in your Mandrill Settings page)[1]
[1]: If you'd just like to try out the Mandrill Message Sender, no problem! You can set up a message sender without a Mandrill API Key. However, this API key allows only a limited number of sends, and more importantly, uses the default OrderCloud-branded email templates! Get your own paid Mandrill account to configure your own custom email templates.
- Go to your OrderCloud Dashboard, and select the Organization that you'd like to configure a Message Sender for. Message Senders are configured at the organization level.
- Select "Message Senders" from the left nav.
- Hit "New"
- Add a name to your message sender, so you can distinguish it at a glance.
- If using the test API key, you're set. If using your own API key, check the box next to "Use My Mandrill Account", and enter in your own Mandrill API key.
- Next, you'll see a list of the various emails the default Mandrill Message Sender allows you to send. Enable the emails you'd like to send.
- Finally, hit "Create Message Sender"
You now have a message sender! However, you're not done just yet. :)
- In the Console, open the Seller Application that you'd like to set up emails for.
- Under "Seller", find "Message Senders" and select it.
- List your message senders. You'll see the message sender you just created, along with the configured message types for that sender.
- Assign that message sender to the buyer or user group that you want. This allows you to configure different emails for different buyers-- Buyer A wants a reply email that reflects their company name but Buyer B wants their own company name there? Buyer C uses Mandrill but Buyer D uses Sendgrid? You're set.
So, OrderCloud is all set up, but if you tried to trigger an email right now, you wouldn't get one. This is because OrderCloud is sending Mandrill data, but Mandrill doesn't know what to do with it yet! Time to set up some email templates.
OrderCloud makes variables available to use in your Mandrill email templates. You can check out the full list [here][../merge-vars.md].
We also provide this repo of default email templates. These email templates have all been tested in the following email clients:
- Outlook
- Gmail
- iOS
However, when you make changes or if your clients use other email clients, we suggest testing your updated templates again. Litmus is a great tool that we recommend.
You need a template for every message type that your message sender is configured for. Your templates must have the exact same name as the message type in OrderCloud.
- Open your MailChimp account, and click on "Templates" in the top nav.
- Click "Create Template", and "Code Your Own"
- Copy/Paste into the MailChimp editor the exact code from the template in this repo. Remember to name the template exactly what the message config name is!
- Save the template to MailChimp.
- In the MailChimp template list, find the template you just made and select the dropdown arrow next to "Edit". Then click "Send to Mandrill".
- If you log into Mandrill now, you will see the template you just made in Mandrill's template list. (Go to "Outbound", then "Templates")
- In our templates, we use the Handlebars merge language to tell Mandrill that our variables are variables, and that it shouldn't be rendered as plain text. However, Mandrill supports several merge languages, so you have to set the merge language. In Mandrill, go to "Settings", then "Sending Defaults", and set the Merge Language to "Handlebars", and save.
You should now get emails for every configuration you set up!
For more information, check out our blog post, or ask us questions in our OrderCloud Community Slack.