<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kevin Fayle</title>
    <description>The latest articles on DEV Community by Kevin Fayle (@natgunner).</description>
    <link>https://dev.to/natgunner</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F99034%2F2948f52e-47db-4825-9ada-9c951126bb17.jpg</url>
      <title>DEV Community: Kevin Fayle</title>
      <link>https://dev.to/natgunner</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/natgunner"/>
    <language>en</language>
    <item>
      <title>Celebrating Success at Scale: How We Built Our Salesforce Slackbot</title>
      <dc:creator>Kevin Fayle</dc:creator>
      <pubDate>Thu, 06 Sep 2018 23:59:39 +0000</pubDate>
      <link>https://dev.to/nylas/celebrating-success-at-scale-how-we-built-our-salesforce-slackbot-3jg</link>
      <guid>https://dev.to/nylas/celebrating-success-at-scale-how-we-built-our-salesforce-slackbot-3jg</guid>
      <description>&lt;p&gt;&lt;a href="https://www.nylas.com/blog/celebrating-success-at-scale-how-we-built-our-salesforce-slackbot" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.nylas.com%2Fhubfs%2Fblog%2520images%2FSlackBotCommunity.png%3Ft%3D1536268959146" alt="Celebrating Success at Scale: How We Built Our Salesforce Slackbot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Nylas API handles more than 100 million API requests per day for customers ranging from up-and-coming startups to Fortune 100 companies. This wouldn’t be possible without a close-knit team that not only works hard together, but celebrates success together.&lt;/p&gt;

&lt;p&gt;That can be hard to do at a fast-paced company, especially with offices on both coasts. But, with a little bit of code and a few APIs, we wired up a Slackbot that gives every employee real-time visibility into new customers joining the Nylas community.&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn2.hubspot.net%2Fhubfs%2F3314308%2Fslackbot-screenshot-edited.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn2.hubspot.net%2Fhubfs%2F3314308%2Fslackbot-screenshot-edited.png" alt="nylas-salesforce-slackbot-screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;Getting rid of the sales gong&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;If a sales gong rings, and no one is around to hear it, does it make a difference? Probably not.&lt;/p&gt;

&lt;p&gt;Cohesion and transparency are essential to building a productive, happy team. Nylas has team members in New York, San Francisco and abroad. So, no matter how hard we hit a sales gong, odds are not every employee would hear it.&lt;/p&gt;

&lt;p&gt;We built a Slackbot to do what a sales gong can’t -- keep everyone in the loop in real time.&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;How the Slackbot helps push Nylas forward &lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;span&gt;Having just&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://www.nylas.com/blog/announcing-our-16m-series-b" rel="noopener noreferrer"&gt;closed a $16M Series B round&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;lead by&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.sparkcapital.com/" rel="noopener noreferrer"&gt;Spark Capital&lt;/a&gt;&lt;span&gt;, we are continuing to grow our team to better serve our rapidly growing customer list.&lt;/span&gt;&lt;span&gt;&amp;nbsp;(&lt;/span&gt;&lt;a href="https://www.nylas.com/jobs/" rel="noopener noreferrer"&gt;Check out our open positions here&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;to apply. When you join, get ready to up your celebratory Slack-moji game.)&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;An expanding team makes it even more important to have good communication and transparency into our shared successes as a company.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;The other side of that is that we wouldn’t be where we are today without our customers. Our Slackbot helps ensure everyone at Nylas - from our operations team to our engineers - recognizes our customers and feels the impact they have on our growth as a company.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;Seeing the wide range of companies that have chosen Nylas to power their applications really gives the team a sense of pride in what we've built, and inspires us to continue providing an excellent customer experience into the future.&lt;/span&gt;&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;How to build your own Salesforce-powered Slackbot&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;To create our Slackbot, we connected our Salesforce instance to Slack and built a process in Salesforce to post in our #general channel whenever a Salesforce deal moves to “Closed - Won”. Now, we can all send 👏 emojis the moment a deal closes. Here’s how you can do the same.&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;Setting up your Slack environment&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;span&gt;First, let’s make a new channel where we can test the bot we’ll be building. This ensures we won’t accidentally &lt;a class="mentioned-user" href="https://dev.to/here"&gt;@here&lt;/a&gt; a popular channel when we're sending out test messages.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Next, you’re going to &lt;a href="https://api.slack.com/slack-apps#creating_apps" rel="noopener noreferrer"&gt;&lt;span&gt;create a Slack app&lt;/span&gt; &lt;/a&gt;and authenticate it by entering in your organization’s Slack credentials.&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn2.hubspot.net%2Fhubfs%2F3314308%2FScreen%2520Shot%25202018-09-06%2520at%252011.58.49%2520AM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn2.hubspot.net%2Fhubfs%2F3314308%2FScreen%2520Shot%25202018-09-06%2520at%252011.58.49%2520AM.png" alt="Screen Shot 2018-09-06 at 11.58.49 AM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;Now, we have Slack channel for our Salesforce updates and&amp;nbsp;&lt;/span&gt;&lt;span&gt;a Slack app to do the updating&lt;/span&gt;&lt;span&gt;. But we still need to get Slack and Salesforce to talk to each other.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;To do that,&amp;nbsp;&lt;/span&gt;&lt;a href="https://api.slack.com/incoming-webhooks" rel="noopener noreferrer"&gt;create an incoming webhook&lt;/a&gt;&lt;span&gt;&amp;nbsp;for your Slack test channel. This will allow&amp;nbsp;&lt;/span&gt;&lt;span&gt;Salesforce&lt;/span&gt;&lt;span&gt;&amp;nbsp;to send information to Slack so Slack can take action accordingly.&lt;/span&gt;&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;Setting up your Salesforce environment&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;span&gt;Those Slack webhooks we set up are hungry for some Salesforce data. We’ll set up our Salesforce instance to deliver just that. Create an Apex class that collects data about the closed deal, builds the Slack message, and posts the message to the webhook address we’ve made in Slack. If you need some guidance here, Taun Abdeen wrote&amp;nbsp;&lt;/span&gt;&lt;a href="https://www.linkedin.com/pulse/slack-salesforce-notify-closedwon-deals-tuan-abdeen-/" rel="noopener noreferrer"&gt;a great LinkedIn post&lt;/a&gt;&lt;span&gt;&amp;nbsp;which features the ins and outs of this step.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Once you’ve set the class to send a message to the test webhook in Slack, we’ll need to create a workflow in &lt;a href="https://help.salesforce.com/articleView?id=process_overview.htm" rel="noopener noreferrer"&gt;Process Builder&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;span&gt;The process we're building will take a certain action based on a certain event. Define the event in Process Builder as when an opportunity moves to “Closed - Won”. Next, create an action that collects data from the closed opportunity and passes it to the Apex class so it can create and post the Slack message.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;Once you’ve created the event and the action in Process Builder, activate the process and we’re off to the races.&lt;/span&gt;&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;Testing your Slackbot&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;span&gt;Once your Salesforce environment and Slack app are talking to each other, it’s time to test your bot. Try moving a demo opportunity to “Closed - Won”. You should see a message post in the test channel you’ve set up. &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;Now, lets bring these alerts to the big time -- the #general channel.&lt;/span&gt;&lt;/p&gt;

&lt;h2&gt;&lt;strong&gt;Bringing it all&amp;nbsp;together&lt;/strong&gt;&lt;/h2&gt;

&lt;p&gt;&lt;span&gt;Finally, create a new webhook for your #general channel and change your Apex class so it posts to the webhook associated with #general as opposed to your test channel.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;After that, it’s time to sit back and get ready to celebrate. 🎉&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

</description>
      <category>featured</category>
      <category>engineering</category>
    </item>
  </channel>
</rss>
