0

auto populate email field

Hi guys

Is there a way to automatically populate an email field with the mailadres from a person from a linked table? In this scenario I don't want to use the Formula-field because this formula field does not give the same possibilities to edit the subject and body in html. 

The reason behind my question is that I want to send the email not via Ninox but via the standard mail program (Outlook in this case). I've noticed that the "OpenURL" does not seem to allow me to edit my body text by adding breaks etc and always opens a blank tab in Safari (not in Google Chrome), which is a bit annoying. Also, using this function it is not possible to automatically add an attachment (pdf in the image field e.g.), I presume?

5 replies

null
    • Mel_Charles
    • 1 yr ago
    • Reported - view

    Jarno - there are a few ways to do it but a simple way from buttons etc

    This one of the ays I do it on my job dockets forms

    So on my my customer card Table I have a field called email

    now on my Jobdockets table every time i enter a job I want the email field to auto fill in the email form the main customer card...and like you i want it to fire my standard outlook client.

    so in the trigger on new record in the Jobdocket form form I simply put

    Customers.Email

     

    ignore the other bit of code in my screen shot ... "let before etc" as that relates to me auto numbers jobs

     

    Not you can auto add attachments using Send Mail (Ninox's in built email system)

    I use both methods very successfully

     

    ie on my job bags 

    I send order Acks & Order dispatched etc

    and thanks you for ordering with us (plus a pdf advert)

    ..

    With the out look method I call outlook then have several preset signature letter preset..

    ie Debt Chase letters etc...

    • Jarno_Vande_Walle
    • 1 yr ago
    • Reported - view

    thank you for the feedback Mel . However, since my two tables are not parent-child tables, I don't think this solution works for me (I tried imputting the formula but had no results). I was curious as to what you said about the automatically adding attachments to the email. What is the code for this? Now I'm using a downloadlink but this is not as user-friendly for the receiver because many people don't want to click links coming from a third party.

    • Mel_Charles
    • 1 yr ago
    • Reported - view

    Jarno

    You said you want to copy the email from a linked table ? as along as you have a link you should be able to extra the email from the other table record.

    Re attachments

    Here is the script from my customer (goods dispatched button) using SendEmail

    This gives calls one of my letters which are stored in a table that holds customer letters templates (SystemFile). Then sends the appropriate message notification plus adds an attachment (advert) (see bold lines)

    should be fairly self explanatory ! 

     

    if Status < 2 or Status > 3 then
        alert("job Status is not in production")
    else
        Status := 3;
        if not 'Email+' then
            alert("No valid contact in email field")
        else
            if DispFlag = 1 then
                alert("Dispatched Confirmation already sent!")
            else
                let thisBody := first((select SystemFile).OrderDispatchedLetter);
                let myEmail := userEmail();
                let myAtt := first(files(record(SystemFile,1)));
                thisBody := replace(thisBody, "{Ord Company}", text('Ord Company'));
                thisBody := replace(thisBody, "{Order Name}", text('Order Name'));
                thisBody := replace(thisBody, "{Job Bag}", text('Job Bag'));
                thisBody := replace(thisBody, "{Order Date}", text('Order Date'));
                thisBody := replace(thisBody, "{Order Name}", 'Order Name');
                thisBody := replace(thisBody, "{Order Ref}", 'Order Ref');
                thisBody := replace(thisBody, "{Qty}", text(Qty));
                thisBody := replace(thisBody, "{Desc}", Desc);
                thisBody := replace(thisBody, "{Del Company}", text('Del Company'));
                thisBody := replace(thisBody, "{Del Address}", text('Del Address'));
                DispFlag := 1;
                sendEmail({
                    from: myEmail,
                    to: 'Email+',
                    subject: "Your order has been dispatched by 118 Printgroup",
                    text: "Goods Dispatched Confirmation",
                    html: thisBody,
                    attachments: myAtt
                });
                alert("Goods Dispatched Email has been Sent");
                DisplayMenu := 1
            end
        end
    end

    • Jarno_Vande_Walle
    • 1 yr ago
    • Reported - view

    Thanks Mel Charles , but this solution, although a good one, would require me to use the SendEmail({ }), which I don't want to do. In fact, I want to use the "Ninox Email Field". If I would be able to get this field to automatically fill in the mailadres from an existing formula-field (using a button?), that would do the trick - but that does not seem to work. Perhaps in the "Default value"?

      • Mel_Charles
      • 1 yr ago
      • Reported - view

      Jarno Vande Walle Yes I know it requires SendMail but you asked me for the information re  attachments. 🙂

      re using outlook client - yes you can get the email box populate I have explained this above

Content aside

  • 1 yr agoLast active
  • 5Replies
  • 100Views
  • 2 Following