Hello Cornelius and others,
I am looking for the most appropriate place(s) to put the SMS function
call. One place i would like to use for testing is the participants tab of
the new appointments (or editing appointments) page. However, i need a
little help finding the right place in the code tree. I’d love to hear from
someone who can help trigger it in a more useful way than i have so far.
The function is as follows:
function send_sms($uid,$body)
{
# $uid = the contact_id column in the egw_addressbook table.
# $body = the message to SMS to the contact.
# Get SMS provider settings and Contact's cell-phone number
$contact_query = "SELECT tel_cell FROM egw_addressbook WHERE
contact_id = $uid";
$contact_result = mysql_query($contact_query) or
die(mysql_error());
$settings_query = “SELECT * FROM sms_settings”;
$settings_result = mysql_query($settings_query) or
die(mysql_error());
# Run the querys
$settings_row = mysql_fetch_array($settings_result);
$contact_row = mysql_fetch_array($contact_result);
# Format and send the SMS-email
$sms_uid = $settings_row['sms_uid'];
$sms_password = $settings_row['sms_pass'];
$from = $settings_row['sms_from_email'];
$sms_provider = $settings_row['sms_domain'];
$subject = $sms_uid . "+" . $sms_password;
$to = str_replace (" ", "", $contact_row['tel_cell'] . "@" .
$sms_provider);
$message = $body;
$headers = “From: $from”;
mail($to,$subject,$message,$headers);
}
I have created an SQL table with the following columns which the above
function seeks for settings:
sms_settings_id int Primary auto_increment (not really needed, just
habit)
sms_uid text (the uid provided by the SMS gateway company)
sms_pass text (the pwd provided by the SMS gateway company)
sms_domain text (the domain name for the email sent to the SMS gateway)
sms_from_email text (the email address the SMS gateway expects your
emails to come from. May not be needed.)
Thanks,
-Andrew G
You can checkout the notifications application from our svn
there allready a plugin for calendar exists. all you have to to is to
wirte a plugin
notification_sms. and maybe hack the prefs a bit, so that useres can
configure this
pulugin themself.
I would be verry interested in your code. What sms-gateway are you using?
cu
cornelius
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers