Results 1 to 8 of 8

Thread: Email Notification Links

  1. #1
    aewatkins is offline Member
    Join Date
    Jun 2008
    Posts
    9

    Default Email Notification Links

    Links to a Sugar record within email notifications (new contact, lead, account notifications, etc.) will take me to the login screen of our Sugar instance; however, after logging in, I get a "Page cannot be displayed". I have checked the "site_url" in the config.php and it is correct. If I am already logged into Sugar, I will be taken directly to the record. So the link is correct. I found this thread about by-passing the login using SOAP - but I do want a login screen if the user is not already logged into Sugar.

    Any ideas on what the issue could be? Thank you!

    Sugar Version: Version 5.0.0f (Build 3338)
    Sugar Edition: SugarPro
    Operating System (server): Windows 2000 Server
    PHP Version: PHP 5.2.6
    Database: MySQL 5
    Web Server: IIS 5

  2. #2
    eNick is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    UK
    Posts
    282

    Default Re: Email Notification Links

    Could you post some examples of the url embedded in the email links?

    It might help show up any obvious errors.
    T H E S U G A R R E F I N E R Y
    : : : SugarCrm Customisation and Integration Services : : :

    SugarCRM Systems Integration Partner
    Trusted with SugarCRM
    http://www.theSugarRefinery.com ::: sales@{removethis}theSugarRefinery.com

  3. #3
    aewatkins is offline Member
    Join Date
    Jun 2008
    Posts
    9

    Default Re: Email Notification Links

    Sure thing....

    <http://www.mydomain.com/mysugarcrm/index.php?module=Tasks&action=DetailView&record=a8 420282-0c58-f42e-c7c2-48888356c7cc>

    If I am logged into Sugar, this link goes right to the task. Otherwise, I get the "page cannot be displayed" after I am prompted to log in.

  4. #4
    eNick is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    UK
    Posts
    282

    Default Re: Email Notification Links

    Well what d'ya know - same thing happens here!

    I'll see if I can find out why.

    It seems it forgets to pass through the module because if I ask for...

    index.php?module=Accounts&action=DetailView&record =7bd3d92c-99e1-db92-6d93-48621912a310

    the line recorded in my log file is...

    GET /sugar/index.php&action=DetailView&record=7bd3d92c-99e1-db92-6d93-48621912a310 HTTP/1.1

    This definitely looks like a bug in Sugar
    Last edited by eNick; 2008-07-25 at 08:24 AM.
    T H E S U G A R R E F I N E R Y
    : : : SugarCrm Customisation and Integration Services : : :

    SugarCRM Systems Integration Partner
    Trusted with SugarCRM
    http://www.theSugarRefinery.com ::: sales@{removethis}theSugarRefinery.com

  5. #5
    eNick is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    UK
    Posts
    282

    Default Re: Email Notification Links

    Ok, I have your answer...


    In modules/Users/Authenticate.php, line 48 onwards change...

    Code:
    if(isset($_SESSION['authenticated_user_id'])) {
    	global $record;
    	$GLOBALS['module'] = !empty($_REQUEST['login_module']) ? '?module='.$_REQUEST['login_module'] : '?module=Home';
    	$GLOBALS['action'] = !empty($_REQUEST['login_action']) ? '&action='.$_REQUEST['login_action'] : '&action=index';
    	$GLOBALS['record']= !empty($_REQUEST['login_record']) ? '&record='.$_REQUEST['login_record'] : '';
    to...
    Code:
    if(isset($_SESSION['authenticated_user_id'])) {
    	global $record;
    	global $module;
    	$GLOBALS['module'] = !empty($_REQUEST['login_module']) ? '?module='.$_REQUEST['login_module'] : '?module=Home';
    	$GLOBALS['action'] = !empty($_REQUEST['login_action']) ? '&action='.$_REQUEST['login_action'] : '&action=index';
    	$GLOBALS['record']= !empty($_REQUEST['login_record']) ? '&record='.$_REQUEST['login_record'] : '';
    ie. insert the declaration "global $module;" after "global $record;".

    Basically, when you're not yet logged in $module hasn't yet been declared as a global variable, so when it is assigned in the statement $GLOBALS['module'] = !empty($_REQUEST['login_module']) ? '?module='.$_REQUEST['login_module'] : '?module=Home'; nothing will happen.

    This will depend, to some extent, on which version of PHP you're running as older versions allowed globals to be defined without explicit declarations.

    You should raise this as a bug with Sugar but the above change will fix your problem.
    T H E S U G A R R E F I N E R Y
    : : : SugarCrm Customisation and Integration Services : : :

    SugarCRM Systems Integration Partner
    Trusted with SugarCRM
    http://www.theSugarRefinery.com ::: sales@{removethis}theSugarRefinery.com

  6. #6
    aewatkins is offline Member
    Join Date
    Jun 2008
    Posts
    9

    Default Re: Email Notification Links

    Thank you! That fixed it! I will report it to Sugar.

  7. #7
    dcurrie is offline Sugar Community Member
    Join Date
    Jul 2007
    Posts
    10

    Default Re: Email Notification Links

    Thanks Nick! This worked great. Its so nice when people take the time to post solutions. I really appreciate it.

    don

  8. #8
    eNick is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    UK
    Posts
    282

    Default Re: Email Notification Links

    You're welcome! Glad its helping people.
    T H E S U G A R R E F I N E R Y
    : : : SugarCrm Customisation and Integration Services : : :

    SugarCRM Systems Integration Partner
    Trusted with SugarCRM
    http://www.theSugarRefinery.com ::: sales@{removethis}theSugarRefinery.com

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. Working with campaings
    By lopes80andre in forum Marketing/Campaign Management
    Replies: 2
    Last Post: 2008-05-16, 07:43 AM
  4. error on links of invite notification email
    By fachtopia in forum General Discussion
    Replies: 0
    Last Post: 2006-07-07, 05:33 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
  •