This topic is locked
[SOLVED]

 Looking for some inspiration

3/29/2017 4:28:21 PM
PHPRunner General questions
H
Hertz2P author

I'm trying to come up with a simple communication tool, and I'm probably overthinking it. What I want is to send communications via email or text to certain groups within a company (management, labor, truck drivers, etc.)
The employee table has everyone in it and also contains everyone's email addresses and email-to-text addresses. I put a field in there called 'categories' and put multiple checkboxes in there for the groups. Using sql query, I can easily identify the groups using a WHERE LIKE %Management% etc. clause.
I ended up building views for each of the categories, but then I thought that's not the best way to proceed because I'd have to make a new view and rebuild every time a new category was added.
Anyway, now I'm just looking for ideas on the best way to build such a tool. I'd like to just have a table where people "Add New" and it captures their login and datetime, and there's just a textfield where they can type a message and click if they want it to be sent to email or text and click on the group they want to send to...
Has anyone build anything similar to this? I'd love to hear some ideas on the best strategy to do it.
Thanks!

H
Hertz2P author 3/29/2017

Okay, solved this one myself, and I gotta say, it came out pretty cool..
Here's what I did for those interested.
Created Some Tables
employees: all basic fields that you'd have for company employees plus these two

emailToText: (have all employees send a text with their name to your email address, this is the reply address)

catageries: this is a lookup wizard checkbox field that allows multiple input and is linked to employee groups table.
employeeGroups table just has a single field: categories
textBlast has 5 fields:

name readonly: $_SESSION["UserName"]

dateTime readonly: now()

subject: textfield

message: text area

group dropdown: link table employeeGroups, categories
So all I had to do was write this event code for textBlast table, add page, before record added



global $dal;

//select text addresses from employees table

$tblUsers = $dal->Table("employees");

$rs = $tblUsers->Query("categories like '%".$values['groups']."%'");//query for the selected category

while ($data = db_fetch_array($rs))

{

$email=$data["emailToText"];//get all addresses that fit the query

$from="messaging@yourcompany.com";//text entry for company default messaging

$msg=$values["message"];//this takes whatever was entered in the 'message' box on textBlast table

$subject=$values['subject'];//this takes whatever subject was entered on textBlast table

$ret=runner_mail(array('to' => $email, 'subject' => $subject,

'body' => $msg, 'from'=>$from));

if(!$ret["mailed"])

echo $ret["message"]."
";

}



You have to make sure your email settings in phprunner work with valid smtp server credentials, and that's it.
Obviously, you can do the same thing for email addresses, just change that field..
It works great, and the coolest part is that the company can add as many groups as they would like and assign employees to them any time they want.
I hope someone finds this helpful, as I didn't see any results like this in my searching.
Cheers!

HJB 3/30/2017



Okay, solved this one myself, and I gotta say, it came out pretty cool..
Here's what I did for those interested.
Created Some Tables
employees: all basic fields that you'd have for company employees plus these two

emailToText: (have all employees send a text with their name to your email address, this is the reply address)

catageries: this is a lookup wizard checkbox field that allows multiple input and is linked to employee groups table.
employeeGroups table just has a single field: categories
textBlast has 5 fields:

name readonly: $_SESSION["UserName"]

dateTime readonly: now()

subject: textfield

message: text area

group dropdown: link table employeeGroups, categories
So all I had to do was write this event code for textBlast table, add page, before record added



global $dal;

//select text addresses from employees table

$tblUsers = $dal->Table("employees");

$rs = $tblUsers->Query("categories like '%".$values['groups']."%'");//query for the selected category

while ($data = db_fetch_array($rs))

{

$email=$data["emailToText"];//get all addresses that fit the query

$from="messaging@yourcompany.com";//text entry for company default messaging

$msg=$values["message"];//this takes whatever was entered in the 'message' box on textBlast table

$subject=$values['subject'];//this takes whatever subject was entered on textBlast table

$ret=runner_mail(array('to' => $email, 'subject' => $subject,

'body' => $msg, 'from'=>$from));

if(!$ret["mailed"])

echo $ret["message"]."
";

}



You have to make sure your email settings in phprunner work with valid smtp server credentials, and that's it.
Obviously, you can do the same thing for email addresses, just change that field..
It works great, and the coolest part is that the company can add as many groups as they would like and assign employees to them any time they want.
I hope someone finds this helpful, as I didn't see any results like this in my searching.
Cheers!


https://xlinesoft.com/massmailer
... for inspiration purposes only, this $50 script is simply the best, allowing to brief foremen by roboted mail under SQL queried time intervals.

H
Hertz2P author 3/31/2017

Thanks Walk2fly, I'll look into that..
I thought I'd add something to augment my solution. It turns out that there are essentially two different email-to-text addresses for most phone companies. T-Mobile has the same address for both SMS and MMS but the others differ and I've found that the SMS ones work better for the purposes of my code, especially if you want the message recipients to be able to reply back to you.
Here are the basic rules:
AT&T SMS Gateway Address:10DigitPhoneNumber@txt.att.net

AT&T MMS Gateway Address:10DigitPhoneNumber@mms.att.net
Sprint SMS Gateway Address:10DigitPhoneNumber@messaging.sprintpcs.com

Sprint MMS Gateway Address:10DigitPhoneNumber@pm.sprint.com
Verizon SMS Gateway Address:10DigitPhoneNumber@vtext.com

Verizon MMS Gateway Address:10DigitPhoneNumber@vzwpix.com
T-Mobile SMS Gateway Address:10DigitPhoneNumber@tmomail.net

T-Mobile MMS Gateway Address:10DigitPhoneNumber@tmomail.net
Also, I found this great little tool to determine which carrier a given number is subscribed to.. Who would've thought that information would be available, let alone free?.. Check it out! Free Carrier Lookup
Anyway, the (construction) company absolutely loves this method of communicating immediately with an unlimited number of different groups of employees.
Cheers.

HJB 4/1/2017



Thanks Walk2fly, I'll look into that..
I thought I'd add something to augment my solution. It turns out that there are essentially two different email-to-text addresses for most phone companies. T-Mobile has the same address for both SMS and MMS but the others differ and I've found that the SMS ones work better for the purposes of my code, especially if you want the message recipients to be able to reply back to you.
Here are the basic rules:
AT&T SMS Gateway Address:10DigitPhoneNumber@txt.att.net

AT&T MMS Gateway Address:10DigitPhoneNumber@mms.att.net
Sprint SMS Gateway Address:10DigitPhoneNumber@messaging.sprintpcs.com

Sprint MMS Gateway Address:10DigitPhoneNumber@pm.sprint.com
Verizon SMS Gateway Address:10DigitPhoneNumber@vtext.com

Verizon MMS Gateway Address:10DigitPhoneNumber@vzwpix.com
T-Mobile SMS Gateway Address:10DigitPhoneNumber@tmomail.net

T-Mobile MMS Gateway Address:10DigitPhoneNumber@tmomail.net
Also, I found this great little tool to determine which carrier a given number is subscribed to.. Who would've thought that information would be available, let alone free?.. Check it out! Free Carrier Lookup
Anyway, the (construction) company absolutely loves this method of communicating immediately with an unlimited number of different groups of employees.
Cheers.


http://www.asprunner.com/forums/topic/22786-sending-record-data-via-sms/
Ed, a November 2014 dated tutorial..., for inspiration purposes only ..., and stay tuned ;-)

H
Hertz2P author 4/1/2017



http://www.asprunner.com/forums/topic/22786-sending-record-data-via-sms/
Ed, a November 2014 dated tutorial..., for inspiration purposes only ..., and stay tuned ;-)


Funny, my code completely eliminates the part of that code that actually costs money.. One could easily do that for free now, but I'm not sure that it would be very useful since the logged in user already has access to the database on their phone.. With today's phones, and bootstrap layout, the texting doesn't seem to be all that advantageous. A few years back, for sure..
I'll probably just keep using it as a quick mass-communication tool, but can't wait to see what you're hinting at <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=81863&image=1&table=forumreplies' class='bbc_emoticon' alt=';)' />

HJB 4/1/2017



Funny, my code completely eliminates the part of that code that actually costs money.. One could easily do that for free now, but I'm not sure that it would be very useful since the logged in user already has access to the database on their phone.. With today's phones, and bootstrap layout, the texting doesn't seem to be all that advantageous. A few years back, for sure..
I'll probably just keep using it as a quick mass-communication tool, but can't wait to see what you're hinting at <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=81865&image=1&table=forumreplies' class='bbc_emoticon' alt=';)' />


quote

Last year, Twilio began allowing developers to embed videoconferencing within any app.

IBM uses the function in a new service called Bluemix that enables doctors at a specialized

cancer clinic in Texas to video-chat directly with patients, eliminating long commutes for routine checkups.

unquote
Well, Ed, the rails are laid down to let your foremen run Video-Chats with construction workers via TWILIO, or say, TWILIO is for developers while yours FREE ones are for the impoverished masses. TWILIO enjoyed a quarter 2016 revenue jump of 62% to $72m or in other words, in short ..., IDEAS are capital, the rest is just money ..., and if you add strong support to your already money spinning IDEAS, your profits are definitely going quickly through the roof. Further, I fully agree, SMS oriented gold rush hours are definitely over <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=81865&image=2&table=forumreplies' class='bbc_emoticon' alt='B)' />
P.S. Once your client is biting into the fleshy foremen/workers Video-Chat bone as per coding seen under https://www.twilio.com/blog/2016/02/building-video-chat-with-ibm-watson-twilio-video-and-webrtc.html, don't forget to trademark your "WhatsEd" issue as otherwise I fear, the relevant famous free app colleagues would certainly go on rampage in no distant time... <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=81865&image=3&table=forumreplies' class='bbc_emoticon' alt=':ph34r:' />

HJB 4/8/2017



quote

Last year, Twilio began allowing developers to embed videoconferencing within any app.

IBM uses the function in a new service called Bluemix that enables doctors at a specialized

cancer clinic in Texas to video-chat directly with patients, eliminating long commutes for routine checkups.

unquote
Well, Ed, the rails are laid down to let your foremen run Video-Chats with construction workers via TWILIO, or say, TWILIO is for developers while yours FREE ones are for the impoverished masses. TWILIO enjoyed a quarter 2016 revenue jump of 62% to $72m or in other words, in short ..., IDEAS are capital, the rest is just money ..., and if you add strong support to your already money spinning IDEAS, your profits are definitely going quickly through the roof. Further, I fully agree, SMS oriented gold rush hours are definitely over <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=81907&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' />
P.S. Once your client is biting into the fleshy foremen/workers Video-Chat bone as per coding seen under https://www.twilio.com/blog/2016/02/building-video-chat-with-ibm-watson-twilio-video-and-webrtc.html, don't forget to trademark your "WhatsEd" issue as otherwise I fear, the relevant famous free app colleagues would certainly go on rampage in no distant time... <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=81907&image=2&table=forumreplies' class='bbc_emoticon' alt=':ph34r:' />


Ed, how far? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=81907&image=3&table=forumreplies' class='bbc_emoticon' alt=':unsure:' />