Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: How to setup email autoresponse upon lead creation?

  1. #1
    apuni is offline Junior Member
    Join Date
    Jul 2008
    Posts
    3

    Default How to setup email autoresponse upon lead creation?

    Anyone that switch from Salesforce to Sugar might have run into that issue.

    Here my backgroud:
    I served customer using Salesforce for the past 2 years. Now, a new customer is using Sugar so I decided to give it a try, So the majority of my reflex are base on my Salesforce knowledge. I'm absolutly have no programming skills. Writing code does not looks like a solution for me. We are running On-Demand Sugar Pro Version 5.0.0g (Build 3391).

    Here what I trying to acheive:
    - Setup multiple campaign (DONE)
    - Create a web-to-lead form (DONE)
    - Capture lead into Sugar with the campaign ID (DONE)
    - Trigger an email to the lead to thank him for registration (WORKING ON)

    Now if I can make this work, I would than want to add this :
    - send different email based on which campaign the leads are coming from.


    I'm sure I'm not the first one who need this, it seems to be very basic CRM features, and comming from Salesforce, where it is so easy to do, I'm struggling to find help on this.

    Anyone can help?

    Alex

  2. #2
    apuni is offline Junior Member
    Join Date
    Jul 2008
    Posts
    3

    Default Re: How to setup email autoresponse upon lead creation?

    Here some update on what I found:

    According to some other post, I should be able to do it with Workflow. I found that very nice and useful guide bout Workflow:
    http://demo.sugarondemand.com/demo45...owDemo_fs.html

    I was able to create a work flow, that trigger alert email to users but not to lead.

    After more research and few hours call at Sugar support. Ihave found that Workflow can only trigger email lerts to user and not to leads/contacts. (feature request,23930)
    http://www.sugarcrm.com/forums/showt...386#post122386

    It would be nice to have an experiment Sugar user or Admin to confirm that it is not possible to setup an auto response rule.

    The use case remain the same and look fairly basic as a need:
    web to lead form gets submitted
    lead gets automatically created
    workflow sends e-mail to new lead from e-mail template.

    If it is confirm that Workflow cannot handle that at the time, does anyone have other suggestion on how to make it work?

    Thanks

  3. #3
    web1seo is offline Junior Member
    Join Date
    Jun 2008
    Posts
    4

    Default Re: How to setup email autoresponse upon lead creation?

    I am trying to do the exact same. I will let you know if I find anything. Seems like this should be very basic.

  4. #4
    johnlovessugar is offline Junior Member
    Join Date
    Oct 2008
    Posts
    3

    Default Re: How to setup email autoresponse upon lead creation?

    Heres a quick idea...

    There a few fields you need in your leads module...i forgot what was stock and what was customized for us, but here's the jist.

    Workflow...when a lead is saved, the conditions to search for are fields "status" equals NEW..."email sent" equals NONE...these are just examples, mind you....when u input your leads from web to lead, ensure these fields are marked NEW and NONE...in this example, anyway.

    Okay, those conditions are searched for. Alert is email type. either put your message there when you create a new alert or use a custom template you've made. Save. Set recipients...Alert Recipient list...create. Recipient is associated with the target module. Choose custom email and name fields. links show up that allow u to pick which Lead module field will be recipient...chose your email field from the list of Leads fields.
    save all that.

    So, email is sent, all is good, but we need to update those fields so that they dont say NEW and NONE anymore. You do that in Actions.

  5. #5
    web1seo is offline Junior Member
    Join Date
    Jun 2008
    Posts
    4

    Default Re: How to setup email autoresponse upon lead creation?

    Thanks that WORKED!

    I can see the email in the history of lead. Now I must have an email problem because sugar says it sent an email to the lead, but I dont receive. I have tried multiple email addresses.

    The weird thing is that I can send emails when I go to the "Email" tab and they are delivered fine.

  6. #6
    metahousemedia is offline Junior Member
    Join Date
    Feb 2010
    Posts
    2

    Default Re: How to setup email autoresponse upon lead creation?

    Quote Originally Posted by johnlovessugar View Post
    Heres a quick idea...

    There a few fields you need in your leads module...i forgot what was stock and what was customized for us, but here's the jist.

    Workflow...when a lead is saved, the conditions to search for are fields "status" equals NEW..."email sent" equals NONE...these are just examples, mind you....when u input your leads from web to lead, ensure these fields are marked NEW and NONE...in this example, anyway.

    Okay, those conditions are searched for. Alert is email type. either put your message there when you create a new alert or use a custom template you've made. Save. Set recipients...Alert Recipient list...create. Recipient is associated with the target module. Choose custom email and name fields. links show up that allow u to pick which Lead module field will be recipient...chose your email field from the list of Leads fields.
    save all that.

    So, email is sent, all is good, but we need to update those fields so that they dont say NEW and NONE anymore. You do that in Actions.
    Is it possible to do this in CE? I'm frustratingly close using the marketing manager module. The only part I'm missing is being able to change the leads fields automatically once the email is sent.

    Just to clarify:

    1. Lead is created.
    2. Status set to NEW and emailed set to NONE.
    3. Marketing manager then runs a campaign that sends an email to people with NEW and NONE.
    4. This is the part I can't do - once the email has been sent, change the NONE value to SENT.
    5. A different campaign will then pick up the SENT value and send a follow up email to it.

    I have an actions area but it will only allow me to send an email, create a task or call. I need it to adjust the field in the lead automatically.

    I'm not interested in purchasing the pro version.

  7. #7
    fastrega is offline Member
    Join Date
    Jul 2009
    Posts
    10

    Default Re: How to setup email autoresponse upon lead creation?

    Same problem. Still not fixed. I had a Sugar Professional look at it and he agreed there is something wrong. Wheres the update? or give me an earlier version to download.

  8. #8
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: How to setup email autoresponse upon lead creation?

    I use the following code in a logic hook for leads for a special campaign form:

    PHP Code:
    // ---------------------------------------------------------------------------------------------
    // ---------------------------------------------------------------------------------------------
          
    if($event=="before_save"){
    // ---------------------------------------------------------------------------------------------
    // ---------------------------------------------------------------------------------------------

          
    if (($focus->campaign_id == "b10f69dd-7d23-d737-c664-47cd3ceaa949") &&
              (
    $focus->status == "new") &&
              (
    $focus->new_with_id == "1"))
          {
                
    $mailsubj "Thank you for Newsletter Registration";
                
    $mailbody "
    bla bla
    bla bla
    bla bla
                "
    ;
             
             require_once(
    'include/SugarPHPMailer.php');
             require_once(
    "modules/Administration/Administration.php");
             
    $mail = new SugarPHPMailer();
             
    $admin = new Administration();
             
             
    $admin->retrieveSettings();
             if (
    $admin->settings['mail_sendtype'] == "SMTP") {
               
    $mail->Host $admin->settings['mail_smtpserver'];
               
    $mail->Port $admin->settings['mail_smtpport'];
               if (
    $admin->settings['mail_smtpauth_req']) {
                 
    $mail->SMTPAuth TRUE;
                 
    $mail->Username $admin->settings['mail_smtpuser'];
                 
    $mail->Password $admin->settings['mail_smtppass'];
               }
               
    $mail->Mailer   "smtp";
               
    $mail->SMTPKeepAlive true;
             }
             else {
               
    $mail->mailer 'sendmail';
             }
             
             
    $mail->From     $admin->settings['notify_fromaddress'];
             
    $mail->FromName $admin->settings['notify_fromname'];
             
    $mail->ContentType "text/plain"//"text/html"
             
             
    $mail->Subject $mailsubj;
             
             
    $mail->Body =  $mailbody;
             
    $mail->AddAddress($focus->email1$focus->email1);
             if (!
    $mail->send()) {
               
    $GLOBALS['log']->fatal("Mailer error: " $mail->ErrorInfo);
             }  
          }

    // ---------------------------------------------------------------------------------------------
    // ---------------------------------------------------------------------------------------------
          
    // end if logic hook is beforesave
    // ---------------------------------------------------------------------------------------------
    // --------------------------------------------------------------------------------------------- 
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  9. #9
    modernmedia is offline Junior Member
    Join Date
    Dec 2011
    Posts
    3

    Default Re: How to setup email autoresponse upon lead creation?

    Hi Harold,

    I am trying to implement your logic hook into my sugar installation. I have a few questions that I think are pretty straight forward. First I am simply trying to use your script as is except for changing the campaign_id to my own campaign id. That I kinda figured was a gimme.

    Second, I am unsure where to load this code. I am guessing this goes into the logic_hooks.php under the custom/modules/Leads directory. I guess this is the first questions, is this the right file?

    Third, I noticed some other code in the default logic_hooks.php and was wondering does this need to be triggered before the $hook_array['after_ui_frame'] = Array(); ?

    This is what my logic_hooks.php looks like at current.

    PHP Code:

    <?php
    // Do not store anything in this file that is not part of the array or the hook version.  This file will    
    // be automatically rebuilt in the future. 
     
    $hook_version 1
    $hook_array = Array(); 
    // position, file, function 
    $hook_array['before_save'] = Array(); 
    $hook_array['before_save'][] = Array(1'Leads push feed''modules/Leads/SugarFeeds/LeadFeed.php','LeadFeed''pushFeed'); 
    $hook_array['after_ui_frame'] = Array(); 
    $hook_array['after_ui_frame'][] = Array(1'Leads InsideView frame''modules/Connectors/connectors/sources/ext/rest/insideview/InsideViewLogicHook.php','InsideViewLogicHook''showFrame'); 

    // ---------------------------------------------------------------------------------------------
    // ---------------------------------------------------------------------------------------------
          
    if($event=="before_save"){
    // ---------------------------------------------------------------------------------------------
    // ---------------------------------------------------------------------------------------------

          
    if (($focus->campaign_id == "28d22d4b-688e-3fa7-5eb4-4e9cbcc419a9") &&
              (
    $focus->status == "new") &&
              (
    $focus->new_with_id == "1"))
          {
                
    $mailsubj "Thank you for Newsletter Registration";
                
    $mailbody "
    bla bla
    bla bla
    bla bla
                "
    ;
             
             require_once(
    'include/SugarPHPMailer.php');
             require_once(
    "modules/Administration/Administration.php");
             
    $mail = new SugarPHPMailer();
             
    $admin = new Administration();
             
             
    $admin->retrieveSettings();
             if (
    $admin->settings['mail_sendtype'] == "SMTP") {
               
    $mail->Host $admin->settings['mail_smtpserver'];
               
    $mail->Port $admin->settings['mail_smtpport'];
               if (
    $admin->settings['mail_smtpauth_req']) {
                 
    $mail->SMTPAuth TRUE;
                 
    $mail->Username $admin->settings['mail_smtpuser'];
                 
    $mail->Password $admin->settings['mail_smtppass'];
               }
               
    $mail->Mailer   "smtp";
               
    $mail->SMTPKeepAlive true;
             }
             else {
               
    $mail->mailer 'sendmail';
             }
             
             
    $mail->From     $admin->settings['notify_fromaddress'];
             
    $mail->FromName $admin->settings['notify_fromname'];
             
    $mail->ContentType "text/plain"//"text/html"
             
             
    $mail->Subject $mailsubj;
             
             
    $mail->Body =  $mailbody;
             
    $mail->AddAddress($focus->email1$focus->email1);
             if (!
    $mail->send()) {
               
    $GLOBALS['log']->fatal("Mailer error: " $mail->ErrorInfo);
             }  
          }

    // ---------------------------------------------------------------------------------------------
    // ---------------------------------------------------------------------------------------------
          
    // end if logic hook is beforesave
    // ---------------------------------------------------------------------------------------------
    // ---------------------------------------------------------------------------------------------

    ?>

  10. #10
    modernmedia is offline Junior Member
    Join Date
    Dec 2011
    Posts
    3

    Default Re: How to setup email autoresponse upon lead creation?

    Harald,

    Kinda new with sugar, trying to implement this into my install. I tried posting earlier however guess it didn't take so ill try again. Might be that I am a new member.

    I have added your script to my logic_hooks.php files in the custom/modules/Leads and changed the campaign_id to mine. (Can this be removed if I want all new leads created to have an email fired?)

    I am confused exactly where, what file and where in the file to add this? Could you be so kind as to enlighten me exactly where this needs to be placed.

    Thank you very much in advanced,

    RC

    Here is my logic_hooks.php file.

    PHP Code:
    <?php
    // Do not store anything in this file that is not part of the array or the hook version.  This file will    
    // be automatically rebuilt in the future. 
     
    $hook_version 1
    $hook_array = Array(); 

    // position, file, function 
    $hook_array['before_save'] = Array(); 
    $hook_array['before_save'][] = Array(1'Leads push feed''modules/Leads/SugarFeeds/LeadFeed.php','LeadFeed''pushFeed'); 
    $hook_array['after_ui_frame'] = Array(); 
    $hook_array['after_ui_frame'][] = Array(1'Leads InsideView frame''modules/Connectors/connectors/sources/ext/rest/insideview/InsideViewLogicHook.php','InsideViewLogicHook''showFrame'); 
    // ---------------------------------------------------------------------------------------------
    // ---------------------------------------------------------------------------------------------
          
    if($event=="before_save"){
    // ---------------------------------------------------------------------------------------------
    // ---------------------------------------------------------------------------------------------

          
    if (($focus->campaign_id == "b10f69dd-7d23-d737-c664-47cd3ceaa949") &&
              (
    $focus->status == "new") &&
              (
    $focus->new_with_id == "1"))
          {
                
    $mailsubj "Thank you for Newsletter Registration";
                
    $mailbody "
    bla bla
    bla bla
    bla bla
                "
    ;
             
             require_once(
    'include/SugarPHPMailer.php');
             require_once(
    "modules/Administration/Administration.php");
             
    $mail = new SugarPHPMailer();
             
    $admin = new Administration();
             
             
    $admin->retrieveSettings();
             if (
    $admin->settings['mail_sendtype'] == "SMTP") {
               
    $mail->Host $admin->settings['mail_smtpserver'];
               
    $mail->Port $admin->settings['mail_smtpport'];
               if (
    $admin->settings['mail_smtpauth_req']) {
                 
    $mail->SMTPAuth TRUE;
                 
    $mail->Username $admin->settings['mail_smtpuser'];
                 
    $mail->Password $admin->settings['mail_smtppass'];
               }
               
    $mail->Mailer   "smtp";
               
    $mail->SMTPKeepAlive true;
             }
             else {
               
    $mail->mailer 'sendmail';
             }
             
             
    $mail->From     $admin->settings['notify_fromaddress'];
             
    $mail->FromName $admin->settings['notify_fromname'];
             
    $mail->ContentType "text/plain"//"text/html"
             
             
    $mail->Subject $mailsubj;
             
             
    $mail->Body =  $mailbody;
             
    $mail->AddAddress($focus->email1$focus->email1);
             if (!
    $mail->send()) {
               
    $GLOBALS['log']->fatal("Mailer error: " $mail->ErrorInfo);
             }  
          }

    // ---------------------------------------------------------------------------------------------
    // ---------------------------------------------------------------------------------------------
          
    // end if logic hook is beforesave
    // ---------------------------------------------------------------------------------------------
    // ---------------------------------------------------------------------------------------------  
    ?>

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. HOW-TO guide for Email Campaigns.
    By agupta in forum Marketing/Campaign Management
    Replies: 146
    Last Post: 2012-01-31, 03:08 PM
  2. email marketing feature requests
    By maxsutter in forum Feature Requests
    Replies: 1
    Last Post: 2008-10-11, 10:19 AM
  3. Replies: 0
    Last Post: 2008-06-17, 11:56 AM
  4. From lead to order
    By george_bbch in forum Feature Requests
    Replies: 0
    Last Post: 2006-09-26, 02:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •