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

Thread: Where the Create Lead form parameters go?

  1. #1
    dskanth is offline Senior Member
    Join Date
    Mar 2009
    Posts
    97

    Unhappy Where the Create Lead form parameters go?

    Hi, i want to send an email to the specified email address in the create Lead form.
    But my problem is that iam not able to find where the form fields go after we click on Save button.

    I mean, in the create Lead form, we specify the fields like Name, Title, Email, etc. and i want to know in which page we can catch these fields, so that i can send an email to the mentioned address.

    PLease guide me, iam just unable to get it.

  2. #2
    Varun50 is offline Senior Member
    Join Date
    Jul 2009
    Posts
    23

    Default Re: Where the Create Lead form parameters go?

    hi i am also trying to implement this functionality. Please let me know about it that where i can find lead insertion logic.

    Any help is highly appreciable

  3. #3
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Where the Create Lead form parameters go?

    You can do that using a logic_hook before_save.

    The logic_hook function may invoke this function
    PHP Code:
        function send_mail($to$name$message) {
            require_once(
    "modules/Administration/Administration.php");
            require_once(
    "include/SugarPHPMailer.php");

            
    $mail  = new SugarPHPMailer;
            
    $admin = new Administration();
            
    $admin->retrieveSettings();

            if (
    $admin->settings['mail_sendtype'] == "SMTP") {
                
    $mail->Mailer "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->From $admin->settings['notify_fromaddress'];
            
    $mail->FromName = (empty($admin->settings['notify_fromname'])) ? "" $admin->settings['notify_fromname'];

            
    $mail->AddAddress($to->email1$to->name);
            
    $mail->Body wordwrap($message900);
            
    //$mail->Body = from_html(trim($message));
            
    $mail->AltBody from_html(trim($message));
            
    $mail->Subject from_html(($name));
            
    $mail->Send();
        } 
    The first argument is an object containing the fields name (first_name + full_name) and email1.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  4. #4
    dskanth is offline Senior Member
    Join Date
    Mar 2009
    Posts
    97

    Default Re: Where the Create Lead form parameters go?

    Hi andopes, thanks a lot for posting code here. However, this did not work for me.
    please clarify a small thing. I was able to write a mail function in the Logic hook function and send it, but the "To" address must be taken from the Email field of the
    Create Lead form. How to get this field value from the form and use it to send mail ?

    Please help.
    Last edited by dskanth; 2009-08-03 at 01:15 PM.

  5. #5
    Varun50 is offline Senior Member
    Join Date
    Jul 2009
    Posts
    23

    Default Re: Where the Create Lead form parameters go?

    Hi Dskanth

    I m very new to SugarCRM and i dont know how to use logic hooks . so can u can tell me briefly about how to use logic hooks. I have read the manual but there are not plenty of examples given in it and second thing i m interested to know is how u have implemented this logic hooks to send mail to a person who has got the lead. Can u can paste that code for me.

    Waiting for your valuable reply.

  6. #6
    dskanth is offline Senior Member
    Join Date
    Mar 2009
    Posts
    97

    Wink Re: Where the Create Lead form parameters go?

    Hi, first you need to download the logic hooks module from here: http://www.sugarforge.org/frs/downlo...Hook-1.0.2.zip
    Then you go to Admin > Module Loader, and browse to this module zip folder and Upload, then install it by clicking on Install. Accept the license and install it.
    Then go to Admin > Logic hooks at the bottom page, and create a new logic hook.
    Select the Leads module, before_save and give any name to your logic hook, and click Proceed.
    Then, insert the code given above by Andopes, between the comments, and you are done.

    For me, unfortunately the above code did not work, but i could atleast write a sample mail function there, and get it work.

  7. #7
    Varun50 is offline Senior Member
    Join Date
    Jul 2009
    Posts
    23

    Default Re: Where the Create Lead form parameters go?

    Hi Dskanth

    Thanks a lot for your prompt reply. I really appreciate help from your side. But i am facing a problem. When i tired to upload the module. I got the error Abort pclzip.lib.php : Missing zlib extensions. But when i have done php -m on my development server i got zlib module is installed and enabled also i have added extension=php_zlib.so in my php.ini file still i am not been able to install the module. Can u can help me in that. Do you know anywork around for it. Can we can have a chat if u dont mind give me ur yahoo id if possible.

  8. #8
    Varun50 is offline Senior Member
    Join Date
    Jul 2009
    Posts
    23

    Default Re: Where the Create Lead form parameters go?

    And ya for your kind information. I am using SugarCRM 5.02f community edition with RHEL 5 , with mysql 5.0 and Apache/2.0.53 (Unix) mod_fastcgi/2.4.2 DAV/2 and PHP/5.2.10

  9. #9
    dskanth is offline Senior Member
    Join Date
    Mar 2009
    Posts
    97

    Default Re: Where the Create Lead form parameters go?

    Hi, for the zip files to upload properly, check that the zlib extension is not commented in your php.ini file, and also ensure that the cache, custom and modules folders are writable.
    Copy the php.ini file to your Apache/bin folder, Restart your apache server and try again.
    Or try with this another version of module: http://www.sugarforge.org/frs/downlo...1237003708.zip
    Last edited by dskanth; 2009-08-03 at 02:27 PM.

  10. #10
    Varun50 is offline Senior Member
    Join Date
    Jul 2009
    Posts
    23

    Default Re: Where the Create Lead form parameters go?

    Hi dskanth

    i have tried everything you have mentioned. But none is working and i m getting this error only Abort pclzip.lib.php : Missing zlib extensions.

    I need your help . please guide me how i can solve this error and if possible please add me in your yahoo messenger my id is varun_power6000@yahoo.co.in

    Waiting desperately for a reply from your side

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 do I customize the create lead form?
    By jharris in forum Help
    Replies: 1
    Last Post: 2010-02-17, 10:09 AM
  2. Create Lead Form.
    By xmaulino in forum General Discussion
    Replies: 2
    Last Post: 2009-07-28, 01:34 PM
  3. Replies: 1
    Last Post: 2009-02-17, 11:42 AM
  4. How do I create a web 2 lead form with sugar
    By marktaggart in forum Help
    Replies: 1
    Last Post: 2008-07-21, 09:03 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
  •