Forum Discussion

CaroleVandenbe2's avatar
CaroleVandenbe2
Qrew Trainee
4 years ago

Button to generate/send email to specific address with specific fields only once pushed

I've searched and seen several responses to similar questions but nothing exactly this.  Here is what I need to know how to do:

Build a button for a form that when selected, it automatically sends an email to a specified email address, with specified fields from the form.  User doesn't have to do anything other than push the button.  It only sends if the button is pushed.  No checkboxes or date fields need to be toggled, and they don't have to finish populating the email or even hit send.  

It's not a notification, because I don't want it to send every time they change the record, and not a checkbox or field change, because I don't want the user to have to remember to go back in and uncheck anything.  

Your help is appreciated!  Thanks!
Carole

------------------------------
Carole Vandenberg
------------------------------

10 Replies

  • If you make a date / time field called [date / time to trigger email], then you can use this code for a formula URL field to make a button to update that field which will then trigger an email notificaiton set to watch for a change in that field. In the formula below my field ID was 58

    var text URL = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_58=" & URLEncode(Now());


    "javascript:" &
    "$.get('" &
    $TriggerEmailURL &
    "',function(){" &
    "location.reload(true);" &
    "});"
    & "void(0);"

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • CaroleVandenbe2's avatar
      CaroleVandenbe2
      Qrew Trainee
      Thanks - just tried and it says $TriggerEmailURL is not declared.  Is this something I need to do in the Formula URL field as well?

      ------------------------------
      Carole Vandenberg
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        sorry, copy paste error

        var text URL = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
        & "&_fid_58=" & URLEncode(Now());


        "javascript:" &
        "$.get('" &
        $URL &
        "',function(){" &
        "location.reload(true);" &
        "});"
        & "void(0);"

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------
  • An easier way might be to actually have a checkbox that is toggled by the button and then an email notification based on the update to the Checkbox. A button for this would be:

    var text chk = "&_FID_34=";
    var text tk = "token";
    
    "<a class='Vibrant Alert' & href=" & 
    
        URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=" & $tk & "&rid=" & [Record ID#] &
        $chk & "1" &
        "&rdr=" &
            
            URLEncode(URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=" & $tk & "&rid=" & [Record ID#] &
                $chk & "0" &
                "&rdr=" &
                    URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#]))​
    
    & ">Send Email</a>"
    This formula will simply Check and then immediately Un-Check the indicated checkbox field. You will simply need to update the variables at the beginning of the formula with the FID of your checkbox and the application token for your app.

    ------------------------------
    Blake Harrison
    bharrison@datablender.io
    DataBlender - Quick Base Solution Provider
    Atlanta GA
    404.800.1702 / http://datablender.io/
    ------------------------------
    • CaroleVandenbe2's avatar
      CaroleVandenbe2
      Qrew Trainee
      Thanks, Blake!  Working with Mark still, but I did try this too, to see if it solved my issue and it doesn't.  Any thoughts on what could be wrong?  It shows a can't reach the page message.

      ------------------------------
      Carole Vandenberg
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        Please post you code and we will fix the syntax.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------