メニュー

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Instant Lead Alerts with C# and ASP.NET MVC

You probably already have landing pages or product detail views in your web application which you're using to generate some excellent leads for your business. Would you like to let the sales team know right away when you've got a new qualified lead?

In this tutorial we'll use Twilio Programmable SMS to send a message when a new lead is found for a C# and ASP.NET MVC application.

In this example, we'll be implementing instant lead alerts for real estate.

We'll create a landing page for a new house on the market and notify a real estate agent when a user requests more information.

Porchが住宅の建設業者に新規プロジェクトに選定されたときに即時アラートを送信するためにTwilio SMSを使用する方法についてご紹介します。

        
        
        
        
        LeadAlerts.Web/Views/Home/Index.cshtml

        Landing page template

        LeadAlerts.Web/Views/Home/Index.cshtml

        Click the button below to begin!

        Let's Quickly Qualify Quality Leads

        ランディングページのデータを入力する

        住宅用のランディング・ページを表示するには、まず出品された架空の住宅についてのいくばくかのデータが必要です。 

        For demonstration purposes, we've hard-coded the information we need as you can see in this code sample.

              
              
              
              
              LeadAlerts.Web/Controllers/HomeController.cs

              Default application route to render listing data

              LeadAlerts.Web/Controllers/HomeController.cs

              Now that we have the route that will provide our data let's look at how we will render it.

              ランディングページのレンダリング

              In our template, we insert data about the house.

              We also put a form into the sidebar so a user can request additional information about the house and provide contact details.

                    
                    
                    
                    
                    LeadAlerts.Web/Views/Home/Index.cshtml

                    Render a landing page

                    LeadAlerts.Web/Views/Home/Index.cshtml

                    Now that we have rendered our listing let's see how to setup a Twilio REST Client to send messages.

                    Send SMSes and MMSes to the Field

                    Twilio REST APIクライアントを作成する

                    ここでは、認証済み Twilio REST API クライアントを使ってヘルパークラスを作成します。このクライアントは、テキストメッセージを送信する必要があるときにいつでも使用できます。

                    We initialize it with our Twilio account credentials in our Local.config file. You can find them in the console:

                    コンソールの認証情報

                    Credentials and PhoneNumbers are just a thin wrapper for values from Local.config. Here's how it might look:

                    public static string AccountSID
                    {
                        get
                        {
                            return
                              WebConfigurationManager.AppSettings["TwilioAccountSid"];
                        }
                    }
                    
                          
                          
                          
                          
                          LeadAlerts.Web/Domain/NotificationService.cs

                          Send a message with the Twilio Client

                          LeadAlerts.Web/Domain/NotificationService.cs

                          Now that our Twilio REST Client is ready, let's see how we handle a new lead.

                          Handle Some Hot Leads... and POSTs

                          Handle a POST Request

                          This code handles the HTTP POST request from our landing page when our customer fills out a form.

                          It uses our MessageSender class to send a SMS message to the real estate agent's phone number, which is set as an environment variable.

                          リードの名前、電話番号、および問い合わせを、担当者に送信するテキストメッセージの本文に直接含めます。

                                
                                
                                
                                
                                Uses the MessageSender to send messages to sales team members.

                                Handling a new Lead

                                Uses the MessageSender to send messages to sales team members.

                                That's it! Now the agent has all the information they need to immediately follow up on the lead.

                                We've just implemented an application to instantly route leads to a salesperson using text messages. Let's look at some other possible features for your application on the next slide.

                                他に構築できるもの

                                次はどこでしょうか?

                                There's a lot you can build easily with .NET and Twilio! Here are just a couple ideas for what to do next:

                                ブラウザー 通話

                                Twilio Client allows your website users to make and receive phone calls directly from their browsers.

                                通話のトラッキング

                                通話のトラッキングは、さまざまなマーケティングキャンペーンの有効性の測定に役立ちます。

                                これは役に立ちましたか?

                                Thanks for checking out this tutorial! Let us know what you've built - or what you're building - on Twitter.

                                Agustin Camino Jose Oliveros David Prothero Kat King Hector Ortega Lizzie Siegle Paul Kamp Andrew Baker
                                Rate this page:

                                ヘルプが必要ですか?

                                We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.