This is a follow up on the previous posting.
When you insert the {OPT_OUT_TRACKER_NAME} (placeholder) in the email template TinyMCE does not allow a relative URL (at least in my SugarCrm version 5.1.0b).
This means if you are running your site at http://MYSITE.com/ and you want the opt out to be like
<a href="{OPT_OUT_TRACKER_NAME}">Unsubscribe</a>
this will not work. The URL will be changed by TinyMCE/SugarCrm to become <a href="http://MYSITE.com/{OPT_OUT_TRACKER_NAME}">UnSubscribe</a>
which in turn will lead to the following link in the email that is sent
<a href="http://MYSITE.com/http://MYSITE.com/index.php?entryPoint=removeme&identifier=786c8da5-d2e2-d820-08d0-4bd7f064d1b7">UnSubscribe</a>
(please note the bolded text in the line above have the http://MYSITE.com 2 times).
This is due to TinyMCE in the default SugarCrm version not allowing relative urls.
This can be patched in the following file
include\SugarTinyMCE.php
(starting line 57 in my version of SugarCrm)
PHP Code:
var $defaultConfig = array(
'height' => 300,
'width' => '100%',
'theme' => 'advanced',
'theme_advanced_toolbar_align' => "left",
'theme_advanced_toolbar_location' => "top",
'theme_advanced_buttons1' => "",
'theme_advanced_buttons2' => "",
'theme_advanced_buttons3' => "",
'strict_loading_mode' => true,
'mode' => 'exact',
'plugins' => 'advhr,insertdatetime,table,preview,paste,searchreplace,directionality',
'elements' => '',
'extended_valid_elements' => 'style,hr[class|width|size|noshade]',
);
should be changed to
PHP Code:
var $defaultConfig = array(
'height' => 300,
'width' => '100%',
'theme' => 'advanced',
'theme_advanced_toolbar_align' => "left",
'theme_advanced_toolbar_location' => "top",
'theme_advanced_buttons1' => "",
'theme_advanced_buttons2' => "",
'theme_advanced_buttons3' => "",
'strict_loading_mode' => true,
'mode' => 'exact',
//Hack: TinyMCE optout url placeholder prefix with siteurl bug
'relative_urls' => true,
//Hack: TinyMCE optout url placeholder prefix with siteurl bug
'plugins' => 'advhr,insertdatetime,table,preview,paste,searchreplace,directionality',
'elements' => '',
'extended_valid_elements' => 'style,hr[class|width|size|noshade]',
);
Regards
Kenneth Thorman
Bookmarks