Here are some example rules to help you get started.
Add an Automatic Unsubscribe Footer
You can use the Sending Default option to add an automatic unsubscribe footer. You may not want to append an unsubscribe footer to every email, though. You can use Rules to enable or disable the unsubscribe footer for some emails. For example, add the unsubscribe footer only to your emails tagged "marketing":
Add a Tag for Emails Sent with SMTP
If you cannot add Mandrill's custom SMTP headers to influence sending behavior and customize your emails, use a rule instead. Here is an example of a rule that adds the tag password-reset to all emails from the sender email@example.com:
Apply a Template With Editable Content Blocks
Templates allow you to create your email design and store commonly used content to re-use for different transactional emails. You can store templates in Mandrill, and then send emails using the template and providing dynamic, recipient-specific content.
The following rule applies the verify-email template to any messages that have the word verification anywhere in the subject line and places the message content into the editable template block called main.
Now, when you send a message with a subject line like "Your verification email from domain.com", this rule will be applied.
Reject Emails With an Empty Subject Line
Rule conditions also support null values. To create a new rule that rejects any emails that do not have any content in the subject line, set up your rule like the one in this example, but do not type any text or click into the last text field after the matches drop-down menu:
Blacklist a Domain
Mandrill allows you to add email addresses to your Rejection Blacklist manually, but does not allow you to add an entire domain. You can set up a rule to reject any emails from a particular domain. For example, you can send test emails to a domain that does not exist or attempting to block unwanted senders from relaying email through your Mandrill account.
Run a Test on a Random Sample of Emails
In situations where you want to change your email, but you are not sure if the change will be effective. Will recipients open and click more, or will they click less? Maybe you want to do an A/B split test on your change, or maybe you want to limit the change to some small percentage of your emails as a trial.
Use random sample as part of your rule conditions, along with the other criteria for the rule. Then, you can do things like changin a template or modifying a Google Analytics tracking, and those changes will only apply to that random subset.
After the test generates data, use stats comparison reports to chart and compare the differences between the groups. When you are ready to pick a winner, just change the winning rule to match all the time and delete the others.
Create API key, Sender, or Domain-Specific Webhooks
This is useful if you only want events tied to a certain domain, sender email address, or API key to post to a webhook URL. For example, you might want to have all email events from your test environment only POST to a specific test endpoint on your server. In this case, create a new webhook that POSTs to your test endpoint. When creating the webhook, do not select any events. For example:
Then, create a rule that looks for any emails sent from the API key being used for your testing environment and choose your test webhook URL:
You need to create a new rule for each event you want to receive information about (sent, bounced, opened, etc.).
Follow the same steps to create a domain-specific webhook. This time, your rule conditions might look like this: