Automating personalized emails to re-engage old opportunities using Salesforce, Hightouch, and Outreach.io
Learn how to customize messages to missed sales opportunities with simple SQL logic.
Made by: Hightouch
/
5 minutes
No matter how good your sales organization is, inevitably, there will be opportunities that you ultimately fail to convert. However, for many of these, you still have a chance to re-engage the prospect and drive a sale in the future.
At Hightouch, we wanted to build an automated outreach campaign to our “Closed Lost” opportunities to re-engage them. We wanted to personalize the messages based on the reason the customer didn’t purchase Hightouch and send the messages dynamically from the appropriate account executive.
While we use Salesforce as our CRM to track sales, building these campaigns directly in Salesforce would have been difficult. These campaigns rely not just on the “opportunity” records in Salesforce but also on associated contacts and account owners for those records. To support this complexity, we built a more manageable and scalable email strategy using Hightouch to define the logic for each campaign and Outreach.io to facilitate each send.
We’ll explain our specific strategy for Closed Lost emails by utilizing Salesforce, Hightouch, and Outreach.io. This general approach could support any type of email campaign. The real heart of this strategy is managing complex email-sending logic directly in Hightouch using your source-of-truth data in your data warehouse and triggering the emails in Outreach.io.
You have a CRM where you track sales lead statuses. We used Salesforce
You have an email delivery platform. We use Outreach.io.
You have a data warehouse or database to store custom fields from your CRM. We use Snowflake.
You or your team have familiarity with writing SQL queries
To build effective logic for customized campaigns, start at the end goal: what campaign types do you want to send?
We ultimately decided on a few different email campaigns based on the reason that an opportunity was lost. For example, if we lost an opportunity to a competitor, we would want to send an email asking how their implementation with that competitor had gone. If we lost an opportunity because the timing wasn’t right due to budget or strategic constraints, the email would instead check in to see if it was worth reconnecting now that time had passed.
For each campaign in Outreach, we defined rules for when the email could be sent and made a template for what it would include
We added a few fields to our Salesforce opportunity records that our sales team could update whenever they marked an opportunity as “Closed-Lost.”
We added a field for the reason the opportunity was lost. This field will help us map each opportunity to the re-engagement email we want to send.
We added a field for sales reps to indicate if they wanted this opportunity to be included in our automated campaigns so they could opt out the accounts where this wasn’t a good idea.
We added a field for the ideal date to reconnect with the account.
To build automated campaigns from our data warehouse using Hightouch, we had to ensure our Salesforce data was available. We use Fivetran to load data from Salesforce to the data warehouse (e.g., Snowflake).
In Hightouch, we can use SQL to define a model that contains our specific campaign logic. Our SQL model had to accomplish several things:
Query the opportunities on their reconnect date.
Only include opportunities that were marked eligible in Salesforce.
Map the Salesforce “reasons” for the loss to the Outbound.io campaign types.
Set fallback logic for the sender, so we would send from a generic account if the original account owner was no longer in that role.
We accomplished this with this query:
SELECT
OPPORTUNITY_ID,
OWNERS.NAME,
OUTREACH.PROSPECT_ID AS PROSPECTS_ID,
CASEWHEN CLOSED_LOST_CATEGORY_C IN ('Data readiness','Product Gaps') THEN'Closed Lost 1'WHEN CLOSED_LOST_CATEGORY_C IN ('Economic Conditions','Timing') THEN'Closed Lost 2'WHEN CLOSED_LOST_CATEGORY_C IN ('Competition','Pricing') THEN'Closed Lost 3'WHEN CLOSED_LOST_CATEGORY_C IN ('In House') THEN'Closed Lost 4'WHEN CLOSED_LOST_CATEGORY_C IN ('Wrong Person/Persona','No Real Pain','Meeting never happened') THEN'Closed Lost 5'ELSEnullENDAS Sequence_Name,
CASEWHEN GTM_ROLE_C ='AE'AND IS_ACTIVE =TRUETHEN OWNERS.OUTREACH_ID_C
ELSE'123'ENDAS SENDER_OUTREACH_ID
FROM ANALYTICS.STAGING.STG_SALESFORCE__OPPORTUNITIES OPPS
LEFTJOIN ANALYTICS.STAGING.STG_SALESFORCE__USERS OWNERS on OWNER_ID = USER_ID
LEFTJOIN ANALYTICS.STAGING.STG_SALESFORCE__CONTACTS PC on PRIMARY_CONTACT_C = PC.CONTACT_ID
LEFTJOIN ANALYTICS.STAGING.STG_OUTREACH__PROSPECTS OUTREACH on PC.EMAIL = OUTREACH.EMAIL
WHERE OPPS.STAGE_NAME ='Closed Lost'AND DEFERRED_UNTIL_C =CURRENT_DATEAND RECONNECT_RESPONSE_C ='Yes have marketing send a follow-up email from me'AND RENEWAL_OPP_C =FALSE
Finally, we had to set up our sync from Hightouch to Outreach.io. Our Outreach.io campaigns already include logic for when to send new campaigns (such as weekdays), so we just need to sync data whenever we reach the contact date, which our query solves. Hightouch makes it simple to define how the fields from our query map to Outreach.io’s fields.
This campaign has allowed us to scale outreach to our closed lost campaigns and has led to several opportunities opening back up. If you’re considering this approach, remember that you can easily accomplish complex campaign logic across Salesforce object types by writing SQL in Hightouch. This strategy can simplify any number of campaigns. If you’re interested in using Hightouch, you can reach out to our solutions engineers for a demo.