Start Email in Outlook with To and Subject Filled Out

  • 0
  • 1
  • Question
  • Updated 3 months ago
  • In Progress
I am very new to Quick Base so I kind of am looking for help on this with some baby steps (appreciate that in advance)!  I am creating a project management app and created a "Project Directory"  I have one table "Projects" and another table "Contacts".  I created a third table "Project Members"  This table related to both projects and contacts and has another field called Role (to identify their role for the project).  This is for "external" project members

Separately in my Projects table I have several pre-defined roles for our internal project team (Project Administrator, Project Manager, Designer, etc.)

I want to create two "send email" buttons.  One is just for our internal project team and the second is for the entire team so that users can quickly distribute information to project members.  However, they need to type the message body and any attachments in Outlook (at least I think so the way I am envisioning this).

So if I click on the Send Internal Email Button I want a new Outlook message to open with the To box filled out with all of our internal users on the project, and the subject preconfigured to the name of the project.  Email window stays open and user fills in the rest.

If I click on the Send External Email Button I want a new Outlook message to open with the To box filled out with all of our external users on the project.  All of our internal users (except the logged in user) on the CC line, and the subject preconfigured to the name of the project.  Email window stays open and user files in the rest.

So help on this??

SO much appreciated in advance!
Photo of Ivan Weiss

Ivan Weiss

  • 1,304 Points 1k badge 2x thumb

Posted 3 months ago

  • 0
  • 1
It’s all possible and the fastest way to get that working would be to book an hour with me. I can be found at www.QuickBaseCoach.com

If your budget can only handle slow, we can also do this step by step in this forum but there will be a few techniques required to get all that to work, so it will take lots of baby steps to get it all working.

But either way is ok with me.
Photo of Jordan McAlister

Jordan McAlister

  • 1,522 Points 1k badge 2x thumb
Hey! Below is some of my code that I use for you to copy if you'd like. My URL formula button opens up an email in outlook with the "To" and "Subject" already filled in as well as some of the body based on some conditions.

______________________________________________________________________

var text URLONE = "MailTo:emailaddress1"
&
If([District]="Longview",
"; emailaddress2; emailaddress3",""
)
&"?cc= "
&"&subject=" &
If(
[Time Frame]="Priority","Approved Priority Job WR ","Approved Job WR "
)
&[WR #]

&"&body=WR "&[WR #] & " has been approved. Attached is the job packet" &
If([District]="Longview",
" and locate sheet." & "%0d%0a%0d%0a" & "CIR " & [Circuit] & " " & [Substation],"."
)
;

$URLONE
______________________________________________________________________

My URL button with this code gives me this result when I click the button.




So, for your case, I think you would need a text field that puts all the users in the project into the format of "email1; email2; email3; etc." and name it for example - [Project Email List].

Your URL formula code might look like this:
_____________________________________________________________________

var text URLONE = "MailTo:" & [Project Email List]

&"?cc= "
&"&subject=" & [Project Name];

$URLONE
______________________________________________________________________

Then your users can fill out the rest, unless you want some sort of pre constructed body format.

Hope this helps.
Photo of Ivan Weiss

Ivan Weiss

  • 1,304 Points 1k badge 2x thumb
Okay so this helps A LOT and I appreciate the time to post this!

Now what I am not sure of is how I can create that email list.....

Is it an automation where I need to append to data in a field and add the email address with a semi colon?

Or is it a formula and do I have it set to add the text strings together?

But how do I access the email address from the user table for my variable?

So I have (3) users in my app as a test

Aaron Weiss
John Brooks
Ivan Weiss


Lets say I am the "project designer" which is a field in my table and John Brooks is my "project estimator" which is a seperate field in my table.

I have (3) other roles that are fields in my table but they are blank....

How do I generate the email list for the two of us?
The field you would create in your Project record would be like

List(";", 
UserToEmail([Project designer userid field]),
UserToEmail([Project estimator userid field]),
UserToEmail([Project planner userid field]))

That will provide a semi colon delimited list of email addresses.

.. a few other tips

to introduce a carriage return use

&"%0A%0A"

The above will do two of them to create a new line with  as pace between the previous line.

The other tip is that for any text in thew subject or body, you need to URLEncode because you are creating a URL and URLs do now allow for special characters.  So for example


& "&subject=" & URLEncode( ..... the subject)

& "&body=" & URLEncode( ..... the body)

Photo of Ivan Weiss

Ivan Weiss

  • 1,304 Points 1k badge 2x thumb
Thanks for the List comment!  That is exactly what I was missing.  I was thinking I needed to iterate through them to see if they were blank first.  That is what tripped me up....

Okay so one more question and we got it set....

On the projects table I am displaying the fields we used above and I have the button created to email them.

I have a "child" table labeled Project Members for Contacts that are external to us.  So on my projects form I want to have a button that is able to email those child table of project members (all of the ones that relate to the project table I am on) and cc the internal members of the team.

CC'ing the internal members is easy based on the information I have.  What I am not sure is how to get the record of that child data to a button on the parent table....
Photo of Jordan McAlister

Jordan McAlister

  • 1,522 Points 1k badge 2x thumb
Hmmm, Mark may be more experienced to help with that one. The only I can think of for that is, perhaps, creating the button in the Project Members table and then making a report with just that button in it. Then, adding a report link field in the Projects Table and adding it to the Project Form as an embedded report, then you'll see the button from the Project Form.

Something similar to this..


Maybe Mark will have a simpler solution.
Yep, I knew that question was coming but I wanted to eat this elephant just one bite at a time.

So last December or so we got a new type of Summary field called Combined text summary.

So make a Combined Text summary field of the email addresses of the external members.  Call it like

[Combined Text summary of all external emails (raw)]   

On the parent table it will be a combined text summary field type, so then make a new field with a clean name like

[External Team member emails]

The formula will be]

ToText([Combined Text summary of all external emails (raw)])

Conveniently that results in a semi colon delimited list, and you should be able to use that  in your mailto formula field.

If you need to have commas as a separator, then

the formula would be
SearchAndReplace(
ToText([Combined Text summary of all external emails (raw)]),";",","
)


  
Photo of Ivan Weiss

Ivan Weiss

  • 1,304 Points 1k badge 2x thumb
So that is where I assumed this was headed as well and I tried to create the summary field in my Projects Table.  However my Project members table is a many to many table that is related to my contacts table.

I am trying to summary Combined Text over Contact-Email and it says that summary function cannot be applied to this field.

Is it because I am in a multi level relation?
Can you try this

Make a formula field in the many to many child table called 
[email in text format]

the formula will be

ToText([email field])

Now you have a text field to summarize and it will work.
Photo of Ivan Weiss

Ivan Weiss

  • 1,304 Points 1k badge 2x thumb
That worked!  But I am still getting one bug that I am struggling with....  For some reason my cc line is inserting the email address correctly but the ?subject code is also appearing in the cc line.  This only happens on the external list.  With the internal list there is no cc line and it works perfectly.  Here is my code:

var text URLONE = "MailTo:" & [Combined Text External  Email List]

&"?cc=" & [Internal Email List]
&"?subject=" & [Name];

$URLONE
There is only one ?, and that is after the before the cc, like you have.

The subject and the body indicators are not preceded with a ?

& "&subject=" & URLEncode([Name]);
& "&body=" & & URLEncode([your body text field]) 
Photo of Ivan Weiss

Ivan Weiss

  • 1,304 Points 1k badge 2x thumb
And that did it!  Thanks SO MUCH for all of your help!

I absolutely have kept your contact information as right now I am just playing around Quick Base to get an understanding of its capabilities with respect to what we are trying to do before we purchase.  But if we do move forward I will certainly reach out for your training programs if need be as you have been most helpful!
np,
I'm here on the forum or one-on one...

Quick Base is an empowering and amazing product. Most of what you will want to do can be done natively and for that last 10% there are more advanced techniques, but they are still really low code (ie maybe not no code, depending how to count a URL formula field like you just built.)  - so you don't have to learn javascript.

Plus each month there is a new release with new features. Every new feature expands the possibilities of what you can do natively.