Forum Discussion

23 Replies

  • 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!!
  • 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);
  • 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. 
  • 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.
  • 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
  • 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.
  • 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!
  • >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.