Ejemplo n.º 1
0
 public function postEnter(Request $request)
 {
     $validator = Validator::make($request->all(), ['campaign_id' => 'required', 'first_name' => 'required', 'last_name' => 'required', 'email' => 'required|email', 'phone' => 'required', 'street1' => 'required', 'city' => 'required', 'state' => 'required', 'zip' => 'required']);
     if ($validator->fails()) {
         session()->flash('campaign_id', $request->input('campaign_id'));
         return redirect(route('lead'))->withErrors($validator)->withInput();
     }
     $lead = Lead::create($request->all());
     event(new LeadSubmitted($lead));
     session()->flash('entry.done', true);
     return redirect(route('lead.done'));
 }
Ejemplo n.º 2
0
 /**
  * Store a new lead (internal)
  * 
  * @param  StoreNewLeadRequest $request
  * @return Redirect
  */
 public function postStoreLead(StoreNewLeadRequest $request)
 {
     $landing_page_id = $request->get('landing_page_id');
     $landing_page = Landing_Page::find($landing_page_id);
     // Get any custom fields
     $custom = array_where($request->all(), function ($k, $v) {
         return !in_array($k, config('lead.fields'));
     });
     $lead = Lead::create(['landing_page_id' => $landing_page_id, 'first_name' => $request->get('first_name', ''), 'last_name' => $request->get('last_name', ''), 'email' => $request->get('email', ''), 'company' => $request->get('company', ''), 'title' => $request->get('title', ''), 'phone' => $request->get('phone', ''), 'zip' => $request->get('zip', ''), 'address' => $request->get('address', ''), 'city' => $request->get('city', ''), 'state' => $request->get('state', ''), 'country' => $request->get('country', ''), 'custom' => json_encode($custom)]);
     // Send emails
     if ($landing_page->send_email) {
         foreach ($landing_page->users_to_email as $user) {
             \Mail::queue('emails.leads.create', ['lead' => $lead, 'landing_page' => $landing_page], function ($message) use($user, $landing_page) {
                 if (!$landing_page->email_title) {
                     $landing_page->email_title = \Lang::get('lead.email.new_lead', ['title' => $landing_page->title]);
                 }
                 $message->to($user->email)->subject($landing_page->email_title);
             });
         }
     }
     // Link lead to attribution entry
     \Event::fire(new LeadSubmitted($lead));
     return redirect('leads')->with('status', \Lang::get('lead.lead_created', ['landing_page' => $landing_page->title]));
 }
Ejemplo n.º 3
0
 /**
  * @param array $attributes
  * @return static
  */
 public function createLead(array $attributes)
 {
     $lead = $this->lead->create($attributes);
     return $lead;
 }
Ejemplo n.º 4
0
 public function storeLead(LeadRequest $request)
 {
     Lead::create($request->except('_token'));
     return redirect('social');
 }
Ejemplo n.º 5
0
 public function createLead(Request $request)
 {
     $item = Lead::create($request->all());
     return $item;
 }
Ejemplo n.º 6
0
    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        $input = $request->all();
        Lead::create(['first_name' => $request->get('first_name'), 'last_name' => $request->get('last_name'), 'gender' => $request->get('gender'), 'job_title' => $request->get('job_title'), 'company_name' => $request->get('company_name'), 'email' => $request->get('email'), 'phone' => $request->get('phone'), 'interested_product' => $request->get('interested_product'), 'interested_demo' => $request->get('interested_demo'), 'future_seminars' => serialize($request->get('future_seminars')), 'market_segments' => serialize($request->get('market_segments')), 'newsletter' => $request->get('newsletter'), 'interested_brands' => serialize($request->get('interested_brands')), 'notes' => $request->get('notes')]);
        $future_seminar = "";
        foreach ($request->get('future_seminars') as $value) {
            $future_seminar .= $value . " ";
        }
        $interested_brands = "";
        foreach ($request->get('interested_brands') as $values) {
            $interested_brands .= $values . " ";
        }
        $to = 'zain@nmkelectronics.com, info@nmkelectronics.com';
        $subject = 'Lead Form';
        $message = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="format-detection" content="telephone=no" />
        <title>Respmail is a response HTML email designed to work on all major email platforms and smartphones</title>
        <style type="text/css">
          /* RESET STYLES */
          body, #bodyTable, #bodyCell, #bodyCell{height:100% !important; margin:0; padding:0; width:100% !important;font-family:Helvetica, Arial, "Lucida Grande", sans-serif;}
          table{border-collapse:collapse;}
          table[id=bodyTable] {width:100%!important;margin:auto;max-width:500px!important;color:#7A7A7A;font-weight:normal;}
          img, a img{border:0; outline:none; text-decoration:none;height:auto; line-height:100%;}
          a {text-decoration:none !important;border-bottom: 1px solid;}
          h1, h2, h3, h4, h5, h6{color:#5F5F5F; font-weight:normal; font-family:Helvetica; font-size:20px; line-height:125%; text-align:Left; letter-spacing:normal;margin-top:0;margin-right:0;margin-bottom:10px;margin-left:0;padding-top:0;padding-bottom:0;padding-left:0;padding-right:0;}

          /* CLIENT-SPECIFIC STYLES */
          .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} /* Force Hotmail/Outlook.com to display emails at full width. */
          .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div{line-height:100%;} /* Force Hotmail/Outlook.com to display line heights normally. */
          table, td{mso-table-lspace:0pt; mso-table-rspace:0pt;} /* Remove spacing between tables in Outlook 2007 and up. */
      #outlook a{padding:0;} /* Force Outlook 2007 and up to provide a "view in browser" message. */
          img{-ms-interpolation-mode: bicubic;display:block;outline:none; text-decoration:none;} /* Force IE to smoothly render resized images. */
          body, table, td, p, a, li, blockquote{-ms-text-size-adjust:100%; -webkit-text-size-adjust:100%; font-weight:normal!important;} /* Prevent Windows- and Webkit-based mobile platforms from changing declared text sizes. */
          .ExternalClass td[class="ecxflexibleContainerBox"] h3 {padding-top: 10px !important;} /* Force hotmail to push 2-grid sub headers down */


          h1{display:block;font-size:26px;font-style:normal;font-weight:normal;line-height:100%;}
          h2{display:block;font-size:20px;font-style:normal;font-weight:normal;line-height:120%;}
          h3{display:block;font-size:17px;font-style:normal;font-weight:normal;line-height:110%;}
          h4{display:block;font-size:18px;font-style:italic;font-weight:normal;line-height:100%;}
          .flexibleImage{height:auto;}
          .linkRemoveBorder{border-bottom:0 !important;}
          table[class=flexibleContainerCellDivider] {padding-bottom:0 !important;padding-top:0 !important;}

          body, #bodyTable{background-color:#E1E1E1;}
      #emailHeader{background-color:#E1E1E1;}
      #emailBody{background-color:#FFFFFF;}
      #emailFooter{background-color:#E1E1E1;}
          .textContent, .textContentLast{color:#8B8B8B; font-family:Helvetica; padding: 8px; font-size:20px; line-height:125%; text-align:Left;}
          .textContent a, .textContentLast a{color:#205478; text-decoration:underline;}
          .nestedContainer{background-color:#F8F8F8; border:1px solid #CCCCCC;}
          .emailButton{background-color:#205478; border-collapse:separate;}
          .buttonContent{color:#FFFFFF; font-family:Helvetica; font-size:18px; font-weight:bold; line-height:100%; padding:15px; text-align:center;}
          .buttonContent a{color:#FFFFFF; display:block; text-decoration:none!important; border:0!important;}
          .emailCalendar{background-color:#FFFFFF; border:1px solid #CCCCCC;}
          .emailCalendarMonth{background-color:#205478; color:#FFFFFF; font-family:Helvetica, Arial, sans-serif; font-size:16px; font-weight:bold; padding-top:10px; padding-bottom:10px; text-align:center;}
          .emailCalendarDay{color:#205478; font-family:Helvetica, Arial, sans-serif; font-size:60px; font-weight:bold; line-height:100%; padding-top:20px; padding-bottom:20px; text-align:center;}
          .imageContentText {margin-top: 10px;line-height:0;}
          .imageContentText a {line-height:0;}
      #invisibleIntroduction {display:none !important;} /* Removing the introduction text from the view */

          /*FRAMEWORK HACKS & OVERRIDES */
          span[class=ios-color-hack] a {color:#275100!important;text-decoration:none!important;}
          span[class=ios-color-hack2] a {color:#205478!important;text-decoration:none!important;}
          span[class=ios-color-hack3] a {color:#8B8B8B!important;text-decoration:none!important;}

          .a[href^="tel"], a[href^="sms"] {text-decoration:none!important;color:#606060!important;pointer-events:none!important;cursor:default!important;}
          .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {text-decoration:none!important;color:#606060!important;pointer-events:auto!important;cursor:default!important;}


          /* MOBILE STYLES */
          @media only screen and (max-width: 480px){
            /*////// CLIENT-SPECIFIC STYLES //////*/
            body{width:100% !important; min-width:100% !important;} /* Force iOS Mail to render the email at full width. */

            /* FRAMEWORK STYLES */
            /*
            CSS selectors are written in attribute
            selector format to prevent Yahoo Mail
            from rendering media query styles on
            desktop.
          */
            table[id="emailHeader"], table[id="emailBody"], table[id="emailFooter"], table[class="flexibleContainer"] {width:100% !important;}
            td[class="flexibleContainerBox"], td[class="flexibleContainerBox"] table {display: block;width: 100%;text-align: left;}
            /*
            The following style rule makes any
            image classed with "flexibleImage"
            fluid when the query activates.
            Make sure you add an inline max-width
            to those images to prevent them
            from blowing out.
          */
            td[class="imageContent"] img {height:auto !important; width:100% !important; max-width:100% !important;}
            img[class="flexibleImage"]{height:auto !important; width:100% !important;max-width:100% !important;}
            img[class="flexibleImageSmall"]{height:auto !important; width:auto !important;}


            /*
            Create top space for every second element in a block
           */
            table[class="flexibleContainerBoxNext"]{padding-top: 10px !important;}

            /*
            Make buttons in the email span the
            full width of their container, allowing
            for left- or right-handed ease of use.
          */
              table[class="emailButton"]{width:100% !important;}
            td[class="buttonContent"]{padding:0 !important;}
            td[class="buttonContent"] a{padding:15px !important;}

          }

          /*  CONDITIONS FOR ANDROID DEVICES ONLY
      *   http://developer.android.com/guide/webapps/targeting.html
      *   http://pugetworks.com/2011/04/css-media-queries-for-targeting-different-mobile-devices/ ;
          =====================================================*/

          @media only screen and (-webkit-device-pixel-ratio:.75){
            /* Put CSS for low density (ldpi) Android layouts in here */
          }

          @media only screen and (-webkit-device-pixel-ratio:1){
            /* Put CSS for medium density (mdpi) Android layouts in here */
          }

          @media only screen and (-webkit-device-pixel-ratio:1.5){
            /* Put CSS for high density (hdpi) Android layouts in here */
          }
          /* end Android targeting */

          /* CONDITIONS FOR IOS DEVICES ONLY
          =====================================================*/
          @media only screen and (min-device-width : 320px) and (max-device-width:568px) {

          }
          /* end IOS targeting */
        </style>

        <!--[if mso 12]>
        <style type="text/css">
          .flexibleContainer{display:block !important; width:100% !important;}
        </style>
        <![endif]-->
        <!--[if mso 14]>
        <style type="text/css">
          .flexibleContainer{display:block !important; width:100% !important;}
        </style>
        <![endif]-->
      </head>
      <body bgcolor="#E1E1E1" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">


        <center style="background-color:#E1E1E1;">
          <table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable" style="table-layout: fixed;max-width:100% !important;width: 100% !important;min-width: 100% !important;">
            <tr>
              <td align="center" valign="top" id="bodyCell">

                <table bgcolor="#FFFFFF"  border="0" cellpadding="0" style="margin-top: 25px;" cellspacing="0" width="500" id="emailBody">



                  <tr>
                    <td align="center" valign="top">

                      <table border="0" cellpadding="0" cellspacing="0" width="100%" style="color:#FFFFFF;" bgcolor="#3498db">
                        <tr>
                          <td align="center" valign="top">

                            <table border="0" cellpadding="0" cellspacing="0" width="500" class="flexibleContainer">
                              <tr>
                                <td align="center" valign="top" width="500" class="flexibleContainerCell">


                                  <table border="0" cellpadding="30" cellspacing="0" width="100%">
                                    <tr>
                                      <td align="center" valign="top" class="textContent" style="padding:8px">
                                        <h1 style="color:#FFFFFF;line-height:100%;font-family:Helvetica,Arial,sans-serif;font-size:20px;font-weight:normal;margin-bottom:5px;text-align:center;">Lead Form</h1>

                                      </td>
                                    </tr>
                                  </table>

                                </td>
                              </tr>
                            </table>

                          </td>
                        </tr>
                      </table>

                    </td>
                  </tr>


                  <tr>
                    <td valign="top" align="center">
                      <!-- CENTERING TABLE // -->
                      <table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#F8F8F8">
                        <tbody><tr>
                          <td valign="top" align="center">
                            <!-- FLEXIBLE CONTAINER // -->
                            <table width="500" cellspacing="0" cellpadding="0" border="0" class="flexibleContainer">
                              <tbody><tr>
                                <td width="500" valign="top" align="center" class="flexibleContainerCell">
                                  <table width="100%" cellspacing="0" cellpadding="30" border="0">
                                    <tbody><tr>
                                      <td valign="top" align="center">

                                        <!-- CONTENT TABLE // -->
                                        <table width="100%" cellspacing="0" cellpadding="0" border="0">
                                          <tbody><tr>
                                            <td valign="top" class="textContent">
                                              <h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:18px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:left;">First Name</h3>
                                              <div style="text-align:left;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;margin-left:95px;color:#5F5F5F;line-height:135%;">' . $request->get('first_name') . '</div>
                                            </td>
                                          </tr>
                                          <tr>
                                            <td valign="top" class="textContent">
                                              <h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:18px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:left;">Email</h3>
                                              <div style="text-align:left;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;margin-left:95px;color:#5F5F5F;line-height:135%;">' . $request->get('email') . '</div>
                                            </td>
                                          </tr>

                                          <tr>
                                            <td valign="top" class="textContent">
                                              <h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:18px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:left;">Company</h3>
                                              <div style="text-align:left;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;margin-left:95px;color:#5F5F5F;line-height:135%;">' . $request->get('company_name') . '</div>
                                            </td>
                                          </tr>

                                          <tr>
                                            <td valign="top" class="textContent">
                                              <h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:18px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:left;">Phone</h3>
                                              <div style="text-align:left;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;margin-left:95px;color:#5F5F5F;line-height:135%;">' . $request->get('phone') . '</div>
                                            </td>
                                          </tr>

                                          <tr>
                                            <td valign="top" class="textContent">
                                              <h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:18px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:left;">Interested Products</h3>
                                              <div style="text-align:left;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;margin-left:95px;color:#5F5F5F;line-height:135%;">' . $request->get('interested_product') . '</div>
                                            </td>
                                          </tr>

                                          <tr>
                                            <td valign="top" class="textContent">
                                              <h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:18px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:left;">Interested In Demo</h3>
                                              <div style="text-align:left;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;margin-left:95px;color:#5F5F5F;line-height:135%;">' . $request->get('interested_demo') . '</div>
                                            </td>
                                          </tr>

                                          <tr>
                                            <td valign="top" class="textContent">
                                              <h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:18px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:left;">Interested In Attending Of Seminars</h3>
                                              <div style="text-align:left;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;margin-left:95px;color:#5F5F5F;line-height:135%;">' . $future_seminar . '</div>
                                            </td>
                                          </tr>

                                          <tr>
                                            <td valign="top" class="textContent">
                                              <h3 style="color:#5F5F5F;line-height:125%;font-family:Helvetica,Arial,sans-serif;font-size:18px;font-weight:normal;margin-top:0;margin-bottom:3px;text-align:left;">Interested Brands</h3>
                                              <div style="text-align:left;font-family:Helvetica,Arial,sans-serif;font-size:15px;margin-bottom:0;margin-left:95px;color:#5F5F5F;line-height:135%;">' . $interested_brands . '</div>
                                            </td>
                                          </tr>
                                        </tbody></table>


                                      </td>
                                    </tr>
                                  </tbody></table>
                                </td>
                              </tr>
                            </tbody></table>

                          </td>
                        </tr>
                      </tbody></table>

                    </td>
                  </tr>

                  <tr>
                    <td align="center" valign="top">
                      <!-- CENTERING TABLE // -->
                      <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                          <td align="center" valign="top">
                            <!-- FLEXIBLE CONTAINER // -->
                            <table border="0" cellpadding="0" cellspacing="0" width="500" class="flexibleContainer">
                              <tr>
                                <td align="center" valign="top" width="500" class="flexibleContainerCell">
                                  <table class="flexibleContainerCellDivider" border="0" cellpadding="30" cellspacing="0" width="100%">
                                    <tr>
                                      <td align="center" valign="top" style="padding-top:0px;padding-bottom:0px;">

                                        <!-- CONTENT TABLE // -->
                                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                          <tr>

                                          </tr>
                                        </table>
                                        <!-- // CONTENT TABLE -->

                                      </td>
                                    </tr>
                                  </table>
                                </td>
                              </tr>
                            </table>
                            <!-- // FLEXIBLE CONTAINER -->
                          </td>
                        </tr>
                      </table>
                      <!-- // CENTERING TABLE -->
                    </td>
                  </tr>
                  <!-- // END -->




                </table>

                <table bgcolor="#E1E1E1" border="0" cellpadding="0" cellspacing="0" width="500" id="emailFooter">


                  <tr>
                    <td align="center" valign="top">
                      <!-- CENTERING TABLE // -->
                      <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                          <td align="center" valign="top">
                            <!-- FLEXIBLE CONTAINER // -->
                            <table border="0" cellpadding="0" cellspacing="0" width="500" class="flexibleContainer">
                              <tr>
                                <td align="center" valign="top" width="500" class="flexibleContainerCell">
                                  <table border="0" cellpadding="30" cellspacing="0" width="100%">
                                    <tr>
                                      <td valign="top" bgcolor="#E1E1E1">

                                        <div style="font-family:Helvetica,Arial,sans-serif;font-size:13px;color:#828282;text-align:center;line-height:120%;">

                                          <div>NMK Electronics LLC, 8th Street, Al Khabaisi Deira, Dubai - United Arab Emirates.</div>
                                        </div>

                                      </td>
                                    </tr>
                                  </table>
                                </td>
                              </tr>
                            </table>
                            <!-- // FLEXIBLE CONTAINER -->
                          </td>
                        </tr>
                      </table>
                      <!-- // CENTERING TABLE -->
                    </td>
                  </tr>

                </table>
                <!-- // END -->

              </td>
            </tr>
          </table>
        </center>
      </body>
      </html>
      ';
        $headers = 'From: ' . "*****@*****.**" . "\r\n";
        //'Reply-To: no-Reply@.com' . "\r\n" .
        //'X-Mailer: PHP/' . phpversion();
        $headers .= "MIME-Version: 1.0\r\n";
        $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
        mail($to, $subject, $message, $headers);
        return redirect('nmk-lead')->with('message', 'Thank You! Successfully submitted.');
    }