This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// given a proper $token and $consumer... | |
require_once('include/api/RestService.php'); | |
require_once('clients/base/api/OAuth2Api.php'); | |
$service = new RestService(); | |
$api = new OAuth2Api(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client = ZAFClient.init(); | |
var settings = { | |
url: '{{setting.sugarUrl}}', | |
headers: {'oauth-token': '{{setting.sugarOauthAccessToken}}'}, | |
secure: true, | |
type: 'GET', | |
dataType: 'json', | |
contentType: 'application/json', | |
}; | |
client.request(settings).then(function(data){console.log(data);}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- works in MySQL, fails in MSSQL | |
SELECT * FROM contacts WHERE IFNULL(title,’’)=’CEO’; | |
-- works in MSSQL | |
SELECT * FROM contacts WHERE ISNULL(title,’’)=’CEO’; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- works in MySQL, fails in MSSQL | |
SELECT * FROM contacts WHERE title=’CEO’ && title=’CTO’; | |
-- works in both MySQL and MSSQL | |
SELECT * FROM contacts WHERE title=’CEO’ AND title=’CTO’; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $db; | |
echo $db->dbType; | |
if ($db->dbType == ‘mysql’) echo “MySQL is being used”; | |
if ($db->dbType == ‘mssql’) echo “MSSQL is being used”; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// notice the upper-case letter ‘m’ | |
require_once(‘modules/MyModule/MyModule.php’); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// replace this with your mailchimp api key | |
$mailchimp_apikey = "mailchimp-api-key-goes-here"; | |
// create mailchimp api object that is used later to make api calls | |
$mcapi = new MailChimp_API($mailchimp_apikey); | |
/** | |
// Use the following code if you want to look up the status of a batch call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
If you want to keep your SugarCRM server non-accessible from the outside web | |
But you still want to receive MailChimp updates with SugarChimp, this script will help you do so | |
You need to make this script accessible from the outside web and it will allow MailChimp to connect to Sugar through the SuagrChimpWebhook entrypoint | |
All other Sugar requests will get ignored | |
Be sure to change the $sugar_url variable to the path of your index.php script inside your Sugar folder | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$job_strings[] = 'YourJobQueue'; | |
function YourJobQueue() | |
{ | |
$queues_to_process = array( | |
'FirstQueue', | |
'SecondQueue', | |
'ThirdQueue', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Put this immediately before line 92 in SugarModules/modules/off_Dynamic_Target_List/dynamic_AddJobsHere.php | |
**/ | |
// check if sugarchimp table exists and the list has a synced mailchimp list id | |
if (!empty($obj_custom->mailchimp_list_name_c) && $db->getRowCount($db->query("SHOW TABLES LIKE 'sugarchimp'"))==1) | |
{ | |
// insert 'remove mailchimp subscriber' jobs for each record that is getting removed from the prospect_lists_prospects table |
NewerOlder