Hi Everyone,
I am trying to use SMS Framework in combination with rules and/or triggers/actions, workflow and a CCK Phone field-.

Here is the setup:

  • Anonymous users can create content-type X.
  • I am using the CCK Phone field in content-type X to get a user's phone number
  • After a node of content-type X has been submitted, an admin will move this node to a new workflow state.
  • When the stage has changed, I want an SMS message to go out to the author of the post with a tokenized message, like: "your request %title has been approved."

The issue is that the only action available to me for sending out an SMS (when I enable SMS Actions) asks that I specify a recipient of the message. How do I instead use the value of the CCK phone field? I am not married to using CCK Phone field, I just couldn't think of a different option.

Thanks for your help

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

technicka’s picture

Component: SMS Actions » Miscellaneous
GreyHawk’s picture

Not sure, but thought I'd toss a couple ideas (haven't played with SMS on Drupal yet):

1. where you specify a recipient -- can you put in a php snippet or code?
2. If so, then maybe you can directly reference the CCK field or perhaps enable the use of a Token (or implement Token Custom?) to substitute a value...?

Can you define custom actions and have those actions based on tokens? If so, could you create a custom token based on the CCK field that you could then reference?

*Normally, I wouldn't risk wasting your time by tossing out thoughts on something I wasn't familiar with, but I'll be approaching SMS in the next month or so and your issue sounds like something I'd like to do, so I'm intrigued and hoping to help. ;)

technicka’s picture

Thanks for your thoughts GreyHawk. I see what you are saying about using a token or PHP snippet. Attached is a screenshot of the action configuration screen for sending an SMS. It seems that it wouldn't take PHP? But I don't know how to tell if that's true or not...

You can check off "send to author of original post", but that wouldn't help, because the original posters of these nodes are anonymous users, and so they don't have profiles where their numbers could be stored with SMS User.

Any other thoughts?

GreyHawk’s picture

Ah, I see what you mean.

You need a way to duplicate the actions of sending an SMS and to tie it to an action that reads a field...mmm...you might need to create a mini-module so you can grab the CCK phone field and then have a button that fires off an SMS using the send code from the SMS module, passing the CCK Phone field value as the target.

technicka’s picture

Yea that sounds right. Unfortunately I'm not a module developer :( But I am surprised that there is apparently no way to use SMS Framework out of the box to collect a phone number stored in some node and send messages to it. Is the only way then, for SMS Framework out of the box to collect a phone number be through SMS User? (with a number stored in the user's profile)

I know with SMS bulk you can draw numbers from a CCK field with views bulk operations, but this is not the functionality I'm looking for, as it wouldn't work with triggers/actions.

GreyHawk’s picture

My unfamiliarity with the module makes me less-than-qualified to speculate, but I'm guessing that if you can't add a CCK field to the SMS User content type then it wouldn't be available in other forms w/o programming.

One of the additional complications is that you have a manual step where the admin has to move the record or change it before the action is enacted.

I don't know if you could set up an action for "Views Bulk Operations" so that filtering on a CCK field added to SMS user (show the record if the field isn't empty) could initiate a call to any or all records that come up...if so, you could further filter on the date of the most recent modification.

But again, this is only speculation on my part. I'm not set up to test any of those aspects at the moment, else I'd try to give a better / more factual response.

technicka’s picture

SMS User is a part of SMS Framework that gives Drupal users the ability to input their mobile number as part of their user account... so it's not tied to CCK.

Thanks for talking this out with me GreyHawk. Maybe when you delve into SMS Framework yourself you can come back and tell me how you solved this :)

GreyHawk’s picture

You're most welcome, technicka.

...tho when you said "SMS User is a part of SMS Framework that gives Drupal users the ability to input their mobile number as part of their user account" above, that makes me wonder if that mobile # would then a profile token, or if it could easily be exposed as one, as I've been able to access CCK fields that I'd tied to the profile...

If so, would that help...?

Anywho -- this'll be percolating on my mental backburners as I get closer to implementing SMS for my own site, so I'll definitely be cycling back thru. :)

calefilm’s picture

Hi Technicka,

What progress have you made in your effort to use rules and the phone input field to send an automatic text? This seems like an issue that many would like to see resolved. I would like to set up this module and assumed I could implement an automatic SMS outgoing text when a new node was created for instance--i supposed using SMS Framework in combination with SMS Bulk and Rules. Is this not the case?

Thanks

shushu’s picture

Hi,

The module still has many problems, but the basic "PHP" sms_send() works properly.
I managed to use it combined with Ubercart's CA and to send SMS to product owners when an order was created.

Using it with Rules should be similar, and simple enough.
If you have the phone number in the CCK field you can "just" use it with direct PHP calling "sms_send()".

If you need further help, let me know. I don't have too much to walk with you step-by-step, but I am certain you can manage this with some guidance.

Regards,
Shusuh

calefilm’s picture

Thanks Shusuh. I don't know how to go about PHP calling. Where exactly would I write sms_send() ? ANy guidance would be awesome! I know it's a basic question.. otherwise I'll look it up on drupal--I find the answers some how. I'm going to download the module and then mess around with Clickatell..

Thank you for any further assistance!

shushu’s picture

What you need to do is to add new Rule, with the event "after saving new content", and the action "execute custom PHP code".
In the PHP code all you need is to write
sms_send(<number>, <message>);
The number and message can be static, or dynamic using Tokens or the available PHP variables.

I am not certain whether you want to get the phone number from the content being saved or from another node. If it is from another node, then you can load it to a variable using the "Load content by id" action for example.

Does this clarifies enough ?

Feel free to ask again if needed.
Regards,
Shusuh

calefilm’s picture

Thanks a bunch Shusuh! Yes makes sense. I'm sure this will be enough information to go off of for now. If I have any further questions I'll hit you up.

Thank you.

Cale

avigo1980’s picture

#10
shushu - June 5, 2010 - 01:08

Hi,

The module still has many problems, but the basic "PHP" sms_send() works properly.
I managed to use it combined with Ubercart's CA and to send SMS to product owners when an order was created.

Hi,

I'm creating an e-commerce multi-vendor site using UBERCART and PAYPAL.
I'm interested in combining SMS_FRAMEWORK with UBERCART to send a SMS to the specific-seller (product-owner not the store-owner) when an order payment is completed.
I want to send the seller an sms containing the product name...for example.

Can you help me?

Thank you
Angelo

shushu’s picture

I will, after my vacation ;-)

BenK’s picture

Subscribing... Also interested in using sms_send() with Rules module, but wondering what it would take to get this working in Drupal 7.

--Ben

shushu’s picture

Hello,

At last I was able to create a module out of my code, adding an action for Ubercart which sends SMS messages.

Hope this helps at least for part of the issues described in this discussion.

http://drupal.org/project/uc_ca_sms

Regards,
Shushu

shushu’s picture

Hello again,

I created a new integration, this time between Rules and SMS Framework.

All it does is to add new actions for sendning SMS messages, but I think it covers most of the discussion here.

http://drupal.org/project/rules_send_sms

Comments are welcome,
Regards,
Shushu

shushu’s picture

Assigned: Unassigned » shushu
Status: Active » Needs review
wouters_f’s picture

I am very interested in this.
I recently implemented a php website with SMS sending capabilities but not yet with drupal.
I am very interested in this module!

push sms'es (or MMS should be able to work too..)

I have 2 questions

-> Wich software are you using to send sms?
gammu/gnokii/mbuni ??
I made gammu work at home (to remote reboot my pc (and backup a website) by an sms command :)

-> Can a wap server be done with drupal?

shushu’s picture

The SMS Framework is a module that works with a list of SMS gateways, such as www.clickatell.com.
My experience is only with online SMS gateways, but from http://groups.drupal.org/node/12555 it seems that Gnokii suppose to have some kind of support as well.

I don't know about any out-of-the-box Drupal WAP server, so although it is possible, I believe it requires some work.

See this discussion - http://groups.drupal.org/node/4611 - about people trying to achieve this. Unfortunately, it is an old discussion with no proper solutions.

Good luck, and feel free to ask for support if needed.

lesleyfernandes’s picture

I have two content types(customers and meetings) and I want to send a sms message one hour before the meeting to the customer. I have a phone field in the customers content type and a date field in the meeting content type, how can I do that?

Thanks.

shushu’s picture

I believe it is possible using Rules Schedular and the new rules_send_sms module.
Read Rules Schedular tutorial in http://drupal.org/node/515714, read how to make it happen before the time in http://groups.drupal.org/node/78688, and combine it with the details of the current discussion.

If you encounter any problem - let me know and I will try to help.
When you succeed - let us know as well - it can be a great example !

Crom’s picture

subscribing

SocialNicheGuru’s picture

subscribe

shushu’s picture

Status: Needs review » Closed (works as designed)