PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

'To Number' Modification

  1. twescott
    Member

    I have a paid Twilio account, and so when setting up a Twilio alert via Gravity Forms + Twilio integration, I have a blank field where I can type in a mobile phone number of my choice.

    When an item is created in my Gravity form, Twilio then looks to that number and fires off an alert SMS. Great. This is out of the box functionality and it works very well.

    What I'd like to do is pass a user entered field from my Gravity form to this Twilio 'To Number' variable. For instance, in my form, I'll ask for a user's mobile phone number. That way the Twilio alert is sent to my user, and not to me, or to a static 'To Number'.

    There appears to be some precedent for this, as the Message area in the Twilio alert setup allows me to incorporate user entered fields into the SMS message that's sent out.

    To the best of my understanding, this is the relevant line of PHP:

    else{
                                ?>
                                <input type="text" name="gf_twilio_to" value="<?php echo esc_attr($config["meta"]["to"]) ?>">
                                <?php
                            }

    This is the else component in a loop. The loop is looking at my Twilio account status. If it's a sandboxed account, the page will only show me verified numbers to send the alert to. Because I have a paid account, however, I'm forwarded to the else part of this loop, where I can type in a number of my choice.

    Unless I'm completely mistaken, I need to echo the value of my 'Email' variable from one of my Gravity forms. It may not be as easy as that, but, that's why I'm here. I don't know.

    Any help is appreciated.

    Posted 6 years ago on Wednesday August 1, 2012 | Permalink
  2. twescott
    Member

    http://www.gravityhelp.com/forums/topic/twilio-integration

    This thread contains a post by someone who provides code to accomplish this.
    Looking forward to this becoming a built-in feature.

    Posted 6 years ago on Thursday August 2, 2012 | Permalink
  3. Did that code work for you? I don't have a paid account to be able to test it but would like to know if it worked for you. Thanks

    Posted 6 years ago on Friday August 3, 2012 | Permalink
  4. twescott
    Member

    It did, actually. It works well. The SMS is fired off immediately to whatever merge tag I enter into the Twilio setup - as long as the merge tag represents a valid phone number, of course.

    With that said, I can no longer click the 'Select All' checkbox when I'm inspecting my Gravity Forms entries. I'm not sure if that's a consequence of this code, or if something else broke along the way. I'm going take the modified lines out and see if that solves my problem.

    Worried that some other things may have broken as well that I'm just not seeing yet. I'll report back to this thread.

    Very much looking forward to this becoming a standard feature.

    Posted 6 years ago on Friday August 3, 2012 | Permalink
  5. I don't think it is related at all. You modified the plugin code for one of the add-ons, but in a way that should not affect your admin area. It might be a theme or plugin conflict causing that trouble. Please try a new browser first to ensure no JavaScript is cached or anything like that. If that does not help, please see the troubleshooting steps here http://rkt.gs/testing - thank you.

    Posted 6 years ago on Friday August 3, 2012 | Permalink
  6. twescott
    Member

    Yeah, you're right. It wasn't related. We get over 100 entries per day to our form, so I use that select all button daily. Curious that it stopped working the same day I made the change in the code. I may have botched something else along the way without realizing it.

    I'll try your guide, thanks for providing it.

    Posted 6 years ago on Friday August 3, 2012 | Permalink
  7. twescott
    Member

    Found it. It's some kind of conflict with another plugin called SMS Wordpress.

    Posted 6 years ago on Friday August 3, 2012 | Permalink
  8. Thank you for the update.

    Posted 6 years ago on Friday August 3, 2012 | Permalink

This topic has been resolved and has been closed to new replies.