Discussions

Expand all | Collapse all

Need to create email button on a form that sends the form fields (or form) to QB User directly.

Corey Ellis05-29-2018 16:57

_anom Diebolt)11-04-2018 01:47

  • 1.  Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-29-2018 16:57


  • 2.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-29-2018 17:10
    You can create a formula - rich text button that references an email icon image. The button can call two nested urls, the first which is an edit record api command that will trigger an email notification of a for
    ; and the second component is a url redirect


  • 3.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-29-2018 17:34
    HI and thanks for your reply. Would you be able to share the formula to use to trigger email component and then the url redirect?


  • 4.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-29-2018 17:36
    Corey,
    Download the Magic Buttons app and there you'll find a bunch of cool buttons with formula-urls to do what you want.


  • 5.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-30-2018 14:04
    HI Thanks for your reply. I will look at the magic buttons and see if that can help.


  • 6.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-30-2018 14:06
    Use the button to edit a record, check a box and trigger the email.


  • 7.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-29-2018 18:11
    Corey

    Here is an example of a  formula URL button which will change the value of a checkbox and put up a green message for 5 seconds (5000 miliseconds)



    var bool NewToggle = not [Toggle field to send email];

    var text URL = URLRoot() & "db/" & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_80=" & $NewToggle;

    "javascript:" &
    "$.get('" & 
    $url & 
    "',function(){" &
    "$.jGrowl('Email has been sent', {life: 5000, theme: 'jGrowl-green'});" &
    "});" &
    "void(0);"

    Is that what you are trying to do?  Just trigger an email Notification?
     


  • 8.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-30-2018 13:30
    Hi  Thanks for your reply - I am trying to generate an email directly to a QB user with all the fields from  a form (about 10 fields). I used a URL Formula field and created a button with code: URLRoot() & "db/" & Dbid() & "?a=GenEmailRecord&rid=" & [Record ID]  & "&dfid=29" but then it takes me to page where I have to put in the user I want to send the mail to, then hit a send button. I would like to send a direct email with the form fields to a specific user once the button is hit.


  • 9.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-30-2018 17:12
    If the email address is a field on the record, then you can use my post just above this one to "jiggle" a toggle field (ie a checkbox field) on the record and sent an email Notification to the email address.

    If the intended recipient is  not a Quick Base user then be sure to set the Type of email Notification to "Open".


  • 10.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-30-2018 19:13
    Thanks for your help! where do you specify email recipient in the formula so it knows where to send email? It is to an internal QB User. 


  • 11.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-30-2018 19:14
    You will need to have a field on the record to use on the Notification.  If it needs to actually be hard coded to a particular user, then it would be a formula email field type with a formula of

    "john.smith@gmail.com


  • 12.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-30-2018 20:03
    Thanks. I cannot get this to work. The original formula I had works, I just would like to add addtional code, if possible, to send a direct email to a specific QB user. 

    Here is the code I used: URLRoot() & "db/" & Dbid() & "?a=GenEmailRecord&rid=" & [Record ID]  & "&dfid=29"

    Can I add a mailto code or some other logic to the code I have to email direct to a specific User? The above code adds all the fields and information I need to send via email. I am just trying to eliminate the extra step of having the QB email come up and selecting which user you want to send to and then actually hitting the send button. Thanks for your help. 


  • 13.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-30-2018 20:10
    OK, I had thought that you wanted to trigger what is called an Email Notification.

    If you want to use your alternative method which allows the user to customize the email, then you can add a line lke this

    & "&tolist=" & [my email field]

    That will populate the "to box" of that Gen email pop up screen.


  • 14.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 11-02-2018 18:04
    Hi - Is there a way to auto populate a subject line as well?  I am using your combined formula:

    URLRoot() & "db/" & Dbid() & "?a=GenEmailRecord&rid=" & [Record ID]  & "&dfid=32"
    & "&tolist=" & [Finance Admin]

    Wanted to see if I can add a Default subject line to this formula so the subject line is filled in with a custom subject I choose. 


  • 15.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 11-03-2018 00:20
    Not that I know of, perhaps Dan Diebolt knows


  • 16.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-30-2018 20:52
    Beautiful - That worked. Thanks so much! Is there any logic I can add that will also send to the email I specify or is this limit? This actually works good, but If I  can get  it to just send after populating the "to box" that would be amazing. 

    Here is my total code now and it works and I can live with it:
    URLRoot() & "db/" & Dbid() & "?a=GenEmailRecord&rid=" & [Record ID]  & "&dfid=29"
    & "&tolist=" & [Tenrox Admin Email]

    I would like to auto send to the [Tenrox Admin Email] if possible keeping everything the same after populating the "to box". Is there a way to do that? You have been very helpful. Many thanks!!


  • 17.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-30-2018 20:58
    Corey, it sounds like you are not familiar with an automated email Notifications.
    https://help.quickbase.com/user-assistance/notification.html

    is that what you want after all?  Push a button and the email gets sent automatically?

    If so, then you want to set up an email notification based on a checkbox field being changes.,  Then use my earlier suggestion above to make a button to fire the email off.

    var bool NewToggle = not [Toggle field to send email];

    var text URL = URLRoot() & "db/" & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_80=" & $NewToggle;

    "javascript:" &
    "$.get('" & 
    $url & 
    "',function(){" &
    "$.jGrowl('Email has been sent', {life: 5000, theme: 'jGrowl-green'});" &
    "});" &
    "void(0);


  • 18.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-30-2018 22:19
    Thanks Again! I am familiar with the email notifications, but we want it to be transparent to the end user and give them the option to send the email or not. With your help, I created a button which will allow for this. It is part of a workflow and we want end users to be able to choose to send an email request or not. If they choose to send a request via email, I was trying to see if there was a way to fully send to a specific QB user for those requests. What I have now can work, but I was hoping to bypass the actual need to hit the send button in the Gen email pop up screen. If there is a way to do that, I am golden. 

    Thanks Again! Very helpful to me and I really appreciate the insight and help you provided. 


  • 19.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-30-2018 22:33
    Ok, so I'm not sure if your problem is solved yet and I'm still confused by if you want to just fire the email via a Notification, or if you want to pause and allow the user to edit the email body using the GenEmailRecord method.

    But if you are happy now them I am happy.


  • 20.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-31-2018 13:36
    Hi - We don't want to fire an email notification based on field modifications as this would not be transparent to the end user. I want to use the GenEmailRecord method, but want to send directly to a specific user every time (We created a generic account in QB for email purposes). At this point, all I am looking to do is bypass the GenEmailRecord, popup screen where you can edit the body of the email and then hit send. If I put in additional code to just send the email bypassing the need to hit the send button in the GenEmailRecord, that would be great. If not, we can live what we have now and the code you provided works. 

    Thanks again.

    Corey


  • 21.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-31-2018 13:52
    If you want the user to hit a button, see a green pop up saying that the email was sent (hence transparent to the user), then use an email Notification.

    If you prefer to hand edit the email content and manually press Send, then use the GenEmailRecord method.


  • 22.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Posted 05-31-2018 16:00
    Thanks so much. I have the option to do it either way now. I will demo with the team and see what they prefer. Thanks!


  • 23.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Top
    Contributor
    Posted 11-04-2018 01:31
    >If there is a way to do that, I am golden. 



    Lost in Space Episode 44: The Golden Man
    Golden Man Requests Help From Jupiter 2 To Battle Alien Frog
    https://midnitereviews.com/2015/07/lost-in-space-episode-44-the-golden-man/

    Here is a pastie that defines a function youSentEmail() with the following signature
    youSentEmail(dbidTable, rid, dfid, toList, subject, msg);
    Supply the appropriate parameters and a promise will be returned which when it resolves you can do further processing:
    youSentEmail(dbidTable, rid, dfid, toList, subject, msg)
      .then(function() {
        console.log("You Sent Email!");
      });
    Pastie Database
    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=683

    Notes:

    (1) The script first grabs the page ?a=GenEmailRecord and extracts the PageToken form the page. The PageToken is needed to successfully submit the page ?a=DoValidateEmailRecord which does the actual email submission. PageTokens are some type of security nonce which are used by QuickBase to prevent CSRF (Cross-Site Request Forgery).

    (2) The function youSentEmail can be bound to a button click by any of the standard methods. Likewise the parameters toList, subject, msg can be hardcoded or passed from field values on the record.


  • 24.  RE: Need to create email button on a form that sends the form fields (or form) to QB User directly.

    Top
    Contributor
    Posted 11-04-2018 01:47
    (3) The received email looks like this: