3

Send Emails with pictures in the body and also with attachments of your choice .

Since there is a lot of demand for sending emails with images in the body, I created an extended email database for the community.

Using colors in the body is also possible.

In the signature of the message, you can compose a button with a link to your website.

The mails send are archived in a different table.

download link here: https://www.dropbox.com/s/2x5hd6i79fqt7iu/EmailingExtended.ninox?dl=0

note: This is only working with a cloud subscription.

Hope you guys enjoy this.

Steven

8 replies

null
    • Rafael Sanchis
    • Rafael_Sanchis
    • 1 yr ago
    • Reported - view

    Hi Steven Grest Work, I have a problem, I can't send EMail and I have clound subcription. The Message say that the message was sent. I try on Web and Android.

    Some Trick 馃憤

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      Rafael Solved the problem, I can't send EMail to myselft. 馃槥

      Sorry

    • Alan_Cooke
    • 9 mths ago
    • Reported - view

    thank you

    • Mel_Charles
    • 5 mths ago
    • Reported - view

    Hi Steven

    erm not quite getting this

    I want to add my logo into sendEmail

    I've added a png into image file (set to small) and set it to share

    looking at your DB  I have extracted what I think are 3 relevent lines.

    to add into my into existing script (you lines as follows)

    let log1 := first(select Settings).HTMLlogo1;
        let log1 := replace(log1, "{UL1}", shareFile(first(select Settings).Logo1));
            let body := replace(raw(Message), "{logo1}", if 'Include Logo 1 (from Settings Table)' then
                log1

    If I change to suit me it won't accept or save the script

    let log1 := first(select Quote_Chasing).xLogo;
    let log1 := replace(log1, "{URL1}", shareFile(first(select Quote_Chasing).xLogo));
    let body := replace(raw(Message), "{xLogo}", log1;

    So clearly I am going wrong here or I have missed something important

    you apper to have your logos with a formula field - is that right?

    Do I use an image field to hold my logo as you are mention HTML? or simple drop my logo into rich text of something. Also I am not understanding the URL ref . ie i have not copied the url itself (yet?). New area for me so deffo need a bit of explanation and help to understand

    full script

    QuoteSentFlag := null;
    let thisBody := first((select Quote_Chasing).xQuoteLetter);
    let myAtt := QuoteImage;
    let myAtt2 := first((select Contact_Mailing).Advert1);
    let myEmail := userEmail();
    let log1 := first(select Quote_Chasing).xLogo;
    let log1 := replace(log1, "{URL1}", shareFile(first(select Quote_Chasing).xLogo));
    let body := replace(raw(Message), "{xLogo}", log1;

    thisBody := replace(thisBody, "{xFirst}", text(eContact));
    thisBody := replace(thisBody, "{Customer Ref}", 'Customer Ref');
    thisBody := replace(thisBody, "{Quote Description}", 'Quote Description');
    thisBody := replace(thisBody, "{Quote Number}", text(QteNum));
    thisBody := replace(thisBody, "{Quote Date}", text(QteDate));

    sendEmail({
            from: myEmail,
            to: xEmail,
            cc: "test@118123456789.co.uk",
            subject: "Your promo/print quote" + QteNum + "from 118 Print",
            text: "Quote Updated",
            html: thisBody,
            attachments: [myAtt, myAtt2]
        })
     

    • Ninox partner
    • RoSoft_Steven.1
    • 5 mths ago
    • Reported - view

    In the HtmlLogo1 field I have {UL1} > you use {URL1} (a little bit confusing, I know 馃き)

    Also dont't know it it works with .png file, maybe .jpg is better, haven't tried though...

    Maybe that's the case....

    • Mel_Charles
    • 5 mths ago
    • Reported - view

    RoSoft_Steven

    So got up at 6am this morning and after some 4 hours of head scratching and much testing! I finally got there !

    Heres my very cut down trial version

    let thisBody := first((select Settings_Quotes).xQchaseLetter1);
    let log1 := first(select Settings_Quotes).HTMLxLogo;
    let log1 := replace(log1, "{UL1}", shareFile(first(select Settings_Quotes).xLogo));
    let myEmail := userEmail();
    thisBody := replace(thisBody, "{xFirst}", text(eContact));
    thisBody := replace(thisBody, "{Customer Ref}", xName);
    thisBody := replace(thisBody, "{Quote Description}", 'Quote Description');
    thisBody := replace(thisBody, "{Quote Number}", text(QteNum));
    thisBody := replace(thisBody, "{Quote Date}", text(QteDate));
    thisBody := replace(raw(thisBody), "{xLogo}", log1);
    sendEmail({
        from: myEmail,
        to: xEmail,
        subject: "We recently sent you a quote from 118 Print",
        text: "text",
        html: thisBody
    })

    and lovely test result !

    At first - I was struggling because I see in your excellent DB  sample you use two tables one with a message and other with body in the archive and I had missed that and had assumed that "Message" was a reserved word as part of SendEmal/SMTP etc and also I am not composing all the message with one field printing instead to have a message letter that i call from another table. AND - I had complete missed your tab section field referencing the image sizing.

    Also I bought a book on HTML5 (some time ago but never got around to reading - until now. However the fact remains. Steven without your usual help. I could not have achieved this.

    Silly question tho. Given that the internet is all about HTML and given that sending emails is an everyday thing. Then why don't people like Ninox give us a special field ) ie field for logo(images) that will be used with email protocols etc - so you drop the logo into it and it creates an html code snippet !

    Thank you as ever 馃憤

    • Haavard_Hjorteland
    • 4 mths ago
    • Reported - view

    Thank you Steven, this was cool.

    I wanted to try the Buttom Compser to create border styling to a  regulart srcript , not a button in this test. It would be nice to style the border on scripts in some cases. This works kind of, but the problem is that it shows a circle above, probably caused by the ButtonPrefix function. Do you know if it is possible to avoid that? This is not happening when the caption comes from a text field.

    Below is a screenshot with some fake contact info. ButtonCaption3 below is a regular script.

    In the Button_Preview script i replaced this line from your origanal code, where the caption is from a text field:   let b := replace(b, "{caption}", raw(ButtonCaption3));   

    My Button HTML text field is like this. if i increase the "padding:6px 6px", the circle also grows in size.....

    <p>{prefix}<p><a style="border:5px solid {bordercolor2};border-radius:18px;padding: 5px 
     ;background-color:{buttoncolor2};padding:6px 6px;text-align:left;ext-decoration:none;color:{textcolor2};display:inline-block;" href="{urlbutton}" target="_blank">{caption}</a></p>

      • Haavard_Hjorteland
      • 4 mths ago
      • Reported - view

      I figured it out by copy/modify code from the net. 

       

      below is the code I'm using for my fake product example:

      All parameter can be adjusted, the width: is the most important to make it fit.

      In the FX: Background color, Text color and Border style , all set to Transparent.

      html("<!DOCTYPE html>
      <html>
      <head>
      <style>
      h1 {
        width: 380px;
        border-style: groove;
        border-width: 8px;
        padding-top: 5px;
        padding-right: 1px;
        padding-bottom: 5px;
        padding-left: 5px;
        border-color: #6691FF;
        border-radius:20px;
        background-color: black
       }
      </style>
      </head>
      <body>
      <h1 style=font-size:16px><font color=white>" +
      "Product number: " +
      "<font color=yellow>" +
      Product_Nr +
      "<br><font color=white>" +
      "Product: " +
      "<font color=yellow>" +
      Product +
      "<br><font color=white>" +
      "Price_Units: " +
      "<font color=yellow>" +
      Price_Units +
      "<br><font color=white>" +
      "Currency: " +
      "<font color=yellow>" +
      Currency +
      "<br><font color=white>" +
      "Product Category: " +
      "<font color=yellow>" +
      Product_Category +
      "<br><font color=white>" +
      "Product Subcategory: " +
      "<font color=yellow>" +
      Product_subcategory +
      "<br><font color=white>" +
      "Manufactorer: " +
      "<font color=yellow>" +
      Manufactorer +
      "<br><font color=white>" +
      "Country of origion: " +
      "<font color=yellow>" +
      Country_of_origin +
      "<br><font color=white>" +
      "Nutrition pr. 100g: " +
      "<br>" +
      "<font color=cyan>" +
      Nutrition_pr_100g +
      "</h1>
      </body>
      </html>

Content aside

  • 3 Likes
  • 4 mths agoLast active
  • 8Replies
  • 725Views
  • 7 Following