AnsweredAssumed Answered

Idea: How to send a tweet from SugarCRM ?

Question asked by Noah Hall on Sep 1, 2015
Latest reply on Sep 1, 2015 by Noah Hall
I have an upcoming project:
Programmatically send one tweet every X hours to a single record

The record will be chosen based on a set of criteria

Once a record has been tweeted, they should move to the bottom of the list, and should not be tweeted again for at least X amount of days

My current idea is:
1. create a date field: last_tweeted_c
2. create a boolean field: send_tweet_c

3. setup a (cron?) that runs every X hours, scan all records and select the single record in the DB that ranks highest based on a set of IF statements and set send_tweet_c = TRUE

4. in another (cron?) that runs every X hours, send a tweet to the record that has send_tweet_c TRUE
5. timestamp last_tweeted_c to the current time

the idea is that:
1. based on last_tweeted_c : we can ensure an account is not tweeted too often
2. based on send_tweet_c we can force certain records to receive/not receive tweets

3. two crons : one to set which record should be tweeted next, and another cron to send the tweet (this could be done with a single cron

big questions:
1. there are PHP & javascript libraries for programmatically sending tweets, is there a best practice for integrating external libraries with sugarcrm?

2. where would I upload the library in sugarcrm, which folder ?

3. how do I go about setting up the cron job? 

4. Any sugarcrm documentation available?

5. Is there a more 'sugary' way to do this?

Outcomes